diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..dc5b4ae --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,25 @@ +#### Link to ticket + +Please add a link to the ticket being addressed by this change. + +#### Description + +Please include a short description of the suggested change and the reasoning behind the approach you have chosen. + +#### Screenshot of the result + +If your change affects the user interface you should include a screenshot of the result with the pull request. + +#### Checklist + +- [ ] My code is covered by test cases. +- [ ] My code passes our test (all our tests). +- [ ] My code passes our static analysis suite. +- [ ] My code passes our continuous integration process. + +If your code does not pass all the requirements on the checklist you have to add a comment explaining why this change +should be exempt from the list. + +#### Additional comments or questions + +If you have any further comments or questions for the reviewer please add them here. diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml new file mode 100644 index 0000000..6da567b --- /dev/null +++ b/.github/workflows/build_release.yml @@ -0,0 +1,54 @@ +on: + push: + tags: + - '*.*.*' + +name: Create Github Release + +permissions: + contents: write + +jobs: + create-release: + runs-on: ubuntu-latest + env: + COMPOSER_ALLOW_SUPERUSER: 1 + APP_ENV: prod + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Composer install + run: | + docker network create frontend + docker compose run --rm --user=root phpfpm composer install --no-dev -o --classmap-authoritative + docker compose run --rm --user=root phpfpm composer clear-cache + + - name: Building assets for the frontend + run: | + docker compose run --rm node yarn install + docker compose run --rm node yarn build + + - name: Clean up + run: | + sudo chown -R runner:runner ./ + rm -rf node_modules + + - name: Make assets dir + run: | + mkdir -p ../assets + + - name: Create archive + run: | + tar --exclude='.git' -zcf ../assets/${{ github.event.repository.name }}-${{ github.ref_name }}.tar.gz ./ + + - name: Create checksum + run: | + cd ../assets + sha256sum ${{ github.event.repository.name }}-${{ github.ref_name }}.tar.gz > ../assets/checksum.txt + + - name: Create a release in GitHub and uploads assets + run: gh release create ${{ github.ref_name }} --verify-tag --generate-notes ../assets/*.* + env: + GITHUB_TOKEN: ${{ github.TOKEN }} + shell: bash diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index e9d54ce..0f6817e 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -7,8 +7,7 @@ jobs: strategy: fail-fast: false steps: - - name: Checkout - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 2 @@ -26,21 +25,25 @@ jobs: matrix: php: ['8.3'] steps: - - uses: actions/checkout@master + - uses: actions/checkout@v4 + - name: Setup PHP, with composer and extensions uses: shivammathur/setup-php@master with: php-version: ${{ matrix.php }} extension-csv: ctype, dom, iconv, json coverage: none + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - uses: actions/cache@v1 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ matrix.php }}-composer- + - name: Validate composer files run: composer validate composer.json @@ -53,22 +56,27 @@ jobs: php: ['8.3'] steps: - uses: actions/checkout@master + - name: Setup PHP, with composer and extensions uses: shivammathur/setup-php@master with: php-version: ${{ matrix.php }} extension-csv: ctype, dom, iconv, json coverage: none + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - uses: actions/cache@v1 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ matrix.php }}-composer- + - name: Install Dependencies run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist + - name: phpcsfixer run: composer actions/phpcsfixer @@ -81,22 +89,27 @@ jobs: php: ['8.3'] steps: - uses: actions/checkout@master + - name: Setup PHP, with composer and extensions uses: shivammathur/setup-php@master with: php-version: ${{ matrix.php }} extension-csv: ctype, dom, iconv, json coverage: none + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - uses: actions/cache@v1 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ matrix.php }}-composer- + - name: Install Dependencies run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist + - name: twigcs run: composer actions/twigcs @@ -110,9 +123,24 @@ jobs: node-version: 20 - name: install run: yarn install + - name: JS coding standards run: yarn coding-standards-check + markdown: + name: Markdown lint + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@master + - uses: actions/setup-node@v3 + with: + node-version: 20 + - name: install + run: yarn install + + - name: Run markdown lint + run: yarn run coding-standards-check/markdownlint + test-yarn-build: name: Test yarn build assets runs-on: ubuntu-24.04 @@ -122,6 +150,7 @@ jobs: - name: Get yarn cache directory id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v1 with: path: ${{ steps.yarn-cache.outputs.dir }} diff --git a/.woodpecker/deployment.yml b/.woodpecker/deployment.yml new file mode 100644 index 0000000..daa83df --- /dev/null +++ b/.woodpecker/deployment.yml @@ -0,0 +1,24 @@ +when: + - event: release + +skip_clone: true + +steps: + - name: Ansible playbook + image: itkdev/ansible-plugin:1 + pull: true + settings: + id: + from_secret: id + secret: + from_secret: secret + host: + from_secret: host + path: + from_secret: path + user: + from_secret: user + playbook: 'release' + pre_up: + - itkdev-docker-compose-server run --rm phpfpm bin/console cache:clear --no-interaction + - itkdev-docker-compose-server run --rm phpfpm bin/console doctrine:migrations:migrate --no-interaction diff --git a/CHANGELOG.md b/CHANGELOG.md index 19926b6..9c86bd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -78,7 +78,7 @@ Versioning](https://semver.org/spec/v2.0.0.html). ## [1.0.0] - yyyy-mm-dd [Unreleased]: https://github.com/itk-dev/kunstdatabasen/compare/1.6.8...HEAD -[1.6.8]: https://github.com/itk-dev/kunstdatabasen/compare/1.6.7...1.6.8 +[1.7.0]: https://github.com/itk-dev/kunstdatabasen/compare/1.6.8...1.7.0 [1.6.7]: https://github.com/itk-dev/kunstdatabasen/compare/1.6.6...1.6.7 [1.6.6]: https://github.com/itk-dev/kunstdatabasen/compare/1.6.5...1.6.6 [1.6.5]: https://github.com/itk-dev/kunstdatabasen/compare/1.6.4...1.6.5 diff --git a/docker-compose.server.override.yml b/docker-compose.server.override.yml index a019b01..d4eca92 100644 --- a/docker-compose.server.override.yml +++ b/docker-compose.server.override.yml @@ -3,3 +3,12 @@ services: environment: - PHP_MAX_EXECUTION_TIME=60 - PHP_MEMORY_LIMIT=512M + volumes: + - ../../shared/images:/app/public/images + - ../../shared/media:/app/public/media + - ../../shared/.env.local:/app/.env.local + + nginx: + volumes: + - ../../shared/images:/app/public/images + - ../../shared/media:/app/public/media diff --git a/package.json b/package.json index 4fbdc62..c4c3584 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "coding-standards-check/scss": "yarn run coding-standards-check/stylelint", "coding-standards-check/eslint": "eslint --config .eslintrc.js 'assets/**/*.js'", "coding-standards-check/js": "yarn run coding-standards-check/eslint", - "coding-standards-check": "yarn run coding-standards-check/scss; yarn run coding-standards-check/js; yarn run coding-standards-check/markdownlint", + "coding-standards-check": "yarn run coding-standards-check/scss; yarn run coding-standards-check/js", "coding-standards-apply/stylelint": "stylelint --config=.stylelintrc.js 'assets/**/*.scss' --fix", "coding-standards-apply/scss": "yarn run coding-standards-apply/stylelint", "coding-standards-apply/eslint": "eslint --config .eslintrc.js 'assets/**/*.js' --fix",