fix(deps): update all non-major dependencies #764
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: PR CI/CD | |
| on: | |
| pull_request: | |
| branches: [main] | |
| types: [opened, synchronize, reopened, labeled, unlabeled, closed] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| packages: write | |
| concurrency: | |
| group: pr-ci-cd-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| preview-gate: | |
| name: Preview gate | |
| runs-on: ubuntu-latest | |
| outputs: | |
| deploy: ${{ steps.gate.outputs.deploy }} | |
| teardown: ${{ steps.gate.outputs.teardown }} | |
| image-tag: ${{ steps.gate.outputs.image-tag }} | |
| steps: | |
| - id: gate | |
| env: | |
| ACTION: ${{ github.event.action }} | |
| LABEL_NAME: ${{ github.event.label.name }} | |
| HAS_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'deploy:preview') }} | |
| run: | | |
| set -euo pipefail | |
| deploy=false | |
| teardown=false | |
| case "$ACTION" in | |
| labeled) [ "$LABEL_NAME" = "deploy:preview" ] && deploy=true ;; | |
| unlabeled) [ "$LABEL_NAME" = "deploy:preview" ] && teardown=true ;; | |
| opened|synchronize|reopened) [ "$HAS_LABEL" = "true" ] && deploy=true ;; | |
| closed) teardown=true ;; | |
| esac | |
| { | |
| echo "deploy=$deploy" | |
| echo "teardown=$teardown" | |
| echo "image-tag=sha-${GITHUB_SHA:0:7}" | |
| } >> "$GITHUB_OUTPUT" | |
| e2e: | |
| needs: preview-gate | |
| if: ${{ needs.preview-gate.outputs.teardown != 'true' }} | |
| uses: ./.github/workflows/e2e.yml | |
| client-quality: | |
| needs: preview-gate | |
| if: ${{ needs.preview-gate.outputs.teardown != 'true' }} | |
| uses: ./.github/workflows/client-quality.yml | |
| server-quality: | |
| needs: preview-gate | |
| if: ${{ needs.preview-gate.outputs.teardown != 'true' }} | |
| uses: ./.github/workflows/server-quality.yml | |
| with: | |
| working-directory: core | |
| news-quality: | |
| needs: preview-gate | |
| if: ${{ needs.preview-gate.outputs.teardown != 'true' }} | |
| uses: ./.github/workflows/server-quality.yml | |
| with: | |
| working-directory: news | |
| ai-quality: | |
| needs: preview-gate | |
| if: ${{ needs.preview-gate.outputs.teardown != 'true' }} | |
| uses: ./.github/workflows/ai-quality.yml | |
| helm-quality: | |
| needs: preview-gate | |
| if: ${{ needs.preview-gate.outputs.teardown != 'true' }} | |
| uses: ./.github/workflows/helm-quality.yml | |
| openapi-sync: | |
| needs: preview-gate | |
| if: ${{ needs.preview-gate.outputs.teardown != 'true' }} | |
| uses: ./.github/workflows/openapi-sync.yml | |
| client-docker: | |
| needs: [client-quality, openapi-sync] | |
| uses: ./.github/workflows/docker-build-push.yml | |
| with: | |
| context: client | |
| image-name: kontor-client | |
| server-docker: | |
| needs: [server-quality, openapi-sync] | |
| uses: ./.github/workflows/docker-build-push.yml | |
| with: | |
| context: core | |
| image-name: kontor-core | |
| news-docker: | |
| needs: [news-quality] | |
| uses: ./.github/workflows/docker-build-push.yml | |
| with: | |
| context: news | |
| image-name: kontor-news | |
| ai-docker: | |
| needs: [ai-quality] | |
| uses: ./.github/workflows/docker-build-push.yml | |
| with: | |
| context: ai | |
| image-name: kontor-ai | |
| # Keycloak image with the Kontor login theme baked in. | |
| keycloak-docker: | |
| needs: preview-gate | |
| if: ${{ needs.preview-gate.outputs.deploy == 'true' }} | |
| uses: ./.github/workflows/docker-build-push.yml | |
| with: | |
| context: infra/keycloak/theme | |
| image-name: kontor-keycloak | |
| deploy-preview: | |
| needs: [preview-gate, helm-quality, client-docker, server-docker, news-docker, ai-docker, keycloak-docker] | |
| if: ${{ needs.preview-gate.outputs.deploy == 'true' }} | |
| uses: ./.github/workflows/deploy.yml | |
| secrets: inherit | |
| with: | |
| environment: k8s-preview | |
| release-name: kontor-pr-${{ github.event.number }} | |
| namespace: team-3m-pr-${{ github.event.number }} | |
| pr-number: ${{ github.event.number }} | |
| image-tag: ${{ needs.preview-gate.outputs.image-tag }} | |
| action: deploy | |
| preview-comment: | |
| needs: [preview-gate, deploy-preview] | |
| if: ${{ needs.preview-gate.outputs.deploy == 'true' }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| - uses: peter-evans/find-comment@v3 | |
| id: fc | |
| with: | |
| issue-number: ${{ github.event.number }} | |
| comment-author: "github-actions[bot]" | |
| body-includes: Preview environment | |
| - uses: peter-evans/create-or-update-comment@v5 | |
| with: | |
| comment-id: ${{ steps.fc.outputs.comment-id }} | |
| issue-number: ${{ github.event.number }} | |
| edit-mode: replace | |
| body: | | |
| ### Preview environment | |
| | | URL | | |
| |---|---| | |
| | App | https://pr-${{ github.event.number }}.team-3m.stud.k8s.aet.cit.tum.de/ | | |
| | Auth | https://auth.pr-${{ github.event.number }}.team-3m.stud.k8s.aet.cit.tum.de/ | | |
| Test login: `dev` / `dev`. TLS uses Let's Encrypt **staging**, so expect a browser certificate warning on first visit. | |
| Remove the `deploy:preview` label or close the PR to tear this down. | |
| teardown-preview: | |
| needs: preview-gate | |
| if: ${{ needs.preview-gate.outputs.teardown == 'true' }} | |
| uses: ./.github/workflows/deploy.yml | |
| secrets: inherit | |
| with: | |
| environment: k8s-preview | |
| release-name: kontor-pr-${{ github.event.number }} | |
| namespace: team-3m-pr-${{ github.event.number }} | |
| action: teardown |