fix(deps): update all non-major dependencies #3852
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: Backend CI | |
| on: | |
| push: | |
| branches: | |
| - "**" | |
| tags: | |
| - "v*.*.*" | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| backend: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| defaults: | |
| run: | |
| working-directory: backend | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| with: | |
| fetch-depth: 0 | |
| submodules: true | |
| - name: Setup Java | |
| uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '25' | |
| cache: maven | |
| - name: Resolve build metadata | |
| run: | | |
| bash ../.github/scripts/resolve_version.sh >> "$GITHUB_ENV" | |
| - name: Lint | |
| run: mvn -B -Plint -DskipTests verify | |
| - name: Unit tests | |
| run: mvn -B test | |
| - name: Integration tests | |
| run: mvn -B verify | |
| - name: Update third-party licenses (Renovate PRs only) | |
| if: > | |
| github.event_name == 'pull_request' && | |
| startsWith(github.head_ref, 'renovate/') && | |
| github.event.pull_request.head.repo.full_name == github.repository | |
| env: | |
| HEAD_REF: ${{ github.head_ref }} | |
| run: | | |
| # Checking out a pull request leaves the workspace on a detached | |
| # merge commit, so switch to the PR branch before committing to it. | |
| git fetch origin "$HEAD_REF" | |
| git checkout -B "$HEAD_REF" FETCH_HEAD | |
| mvn -B org.codehaus.mojo:license-maven-plugin:add-third-party | |
| # If nothing changed, don't commit | |
| if git diff --exit-code -- LICENSES-THIRD-PARTY.md; then | |
| echo "No changes in LICENSES-THIRD-PARTY.md" | |
| exit 0 | |
| fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add LICENSES-THIRD-PARTY.md | |
| git commit -m "chore: update backend LICENSES-THIRD-PARTY.md" | |
| git push origin "HEAD:$HEAD_REF" | |
| - name: Third-party license check | |
| run: | | |
| mvn -B org.codehaus.mojo:license-maven-plugin:add-third-party | |
| git diff --exit-code -- LICENSES-THIRD-PARTY.md | |
| - name: Set up Docker Buildx | |
| if: github.event_name == 'push' && (github.ref == format('refs/heads/{0}', github.event.repository.default_branch) || startsWith(github.ref, 'refs/tags/')) | |
| uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0 | |
| - name: Log in to GHCR | |
| if: github.event_name == 'push' && (github.ref == format('refs/heads/{0}', github.event.repository.default_branch) || startsWith(github.ref, 'refs/tags/')) | |
| uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract Docker metadata | |
| if: github.event_name == 'push' && (github.ref == format('refs/heads/{0}', github.event.repository.default_branch) || startsWith(github.ref, 'refs/tags/')) | |
| id: meta | |
| uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0 | |
| with: | |
| images: ghcr.io/${{ github.repository }}-backend | |
| tags: | | |
| # output X.Y.Z | |
| type=semver,pattern={{version}} | |
| # output X.Y | |
| type=semver,pattern={{major}}.{{minor}} | |
| # output X (disabled if major zero) | |
| type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }} | |
| # output main on default branch | |
| type=raw,value=main,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} | |
| - name: Build and push image | |
| if: github.event_name == 'push' && (github.ref == format('refs/heads/{0}', github.event.repository.default_branch) || startsWith(github.ref, 'refs/tags/')) | |
| uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 | |
| with: | |
| context: backend | |
| file: backend/Dockerfile | |
| push: true | |
| build-args: | | |
| APP_VERSION=${{ env.APP_VERSION }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} |