fix(deps): update all non-major dependencies #3846
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: Frontend CI | |
| on: | |
| push: | |
| branches: | |
| - "**" | |
| tags: | |
| - "v*.*.*" | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| frontend: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| defaults: | |
| run: | |
| working-directory: frontend | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version: "24" | |
| cache: "npm" | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Resolve build metadata | |
| run: | | |
| bash ../.github/scripts/resolve_version.sh >> "$GITHUB_ENV" | |
| echo "PUBLIC_REPOSITORY_URL=https://github.com/${GITHUB_REPOSITORY}" >> "$GITHUB_ENV" | |
| - name: Clean install | |
| run: npm run clean-install | |
| - 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 | |
| npm run licenses:generate | |
| 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 frontend LICENSES-THIRD-PARTY.md" | |
| git push origin "HEAD:$HEAD_REF" | |
| - name: Test | |
| run: npm run test | |
| - name: Lint | |
| run: npm run lint | |
| - name: Build | |
| env: | |
| PUBLIC_APP_VERSION: ${{ env.APP_VERSION }} | |
| PUBLIC_COMMIT_SHA: ${{ env.COMMIT_SHA }} | |
| PUBLIC_REPOSITORY_URL: ${{ env.PUBLIC_REPOSITORY_URL }} | |
| run: npm run build | |
| - 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 }}-frontend | |
| 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: frontend | |
| file: frontend/Dockerfile | |
| push: true | |
| build-args: | | |
| PUBLIC_APP_VERSION=${{ env.APP_VERSION }} | |
| PUBLIC_COMMIT_SHA=${{ env.COMMIT_SHA }} | |
| PUBLIC_REPOSITORY_URL=${{ env.PUBLIC_REPOSITORY_URL }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} |