Skip to content

test findings fixes #3188

test findings fixes

test findings fixes #3188

Workflow file for this run

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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.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' &&
github.actor == 'renovate[bot]' &&
github.event.pull_request.head.repo.full_name == github.repository
run: |
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
- 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@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.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@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.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@80c7e94dd9b9319bd5eb7a0e0fe9291e23a2a2e9 # v6.1.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@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.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 }}