From 8fd79f88b8e2d8e1cba2ca375b495e20c21ad1f0 Mon Sep 17 00:00:00 2001 From: Hannes Michalek Date: Fri, 13 Dec 2024 14:49:19 +0100 Subject: [PATCH] Add build step --- .github/workflows/frontend-jobs.yml | 45 +++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 6 deletions(-) diff --git a/.github/workflows/frontend-jobs.yml b/.github/workflows/frontend-jobs.yml index 8738551..572799d 100644 --- a/.github/workflows/frontend-jobs.yml +++ b/.github/workflows/frontend-jobs.yml @@ -30,13 +30,46 @@ jobs: - name: Formatting run: npm run format:check working-directory: ./frontend - - name: Send status to Slack - # Third-party action, pin to commit SHA! - # See https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions - uses: digitalservicebund/notify-on-failure-gha@814d0c4b2ad6a3443e89c991f8657b10126510bf # v1.5.0 - if: ${{ failure() && github.ref == 'refs/heads/main' }} + # - name: Send status to Slack + # # Third-party action, pin to commit SHA! + # # See https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions + # uses: digitalservicebund/notify-on-failure-gha@814d0c4b2ad6a3443e89c991f8657b10126510bf # v1.5.0 + # if: ${{ failure() && github.ref == 'refs/heads/main' }} + # with: + # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + + build-frontend: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version-file: ./frontend/package.json + cache: npm + cache-dependency-path: ./frontend/package-lock.json + - name: Cache node_modules + uses: actions/cache@v4 + id: node-modules-cache with: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + path: | + ./frontend/node_modules + key: modules-${{ hashFiles('./frontend/package-lock.json') }} + - name: Install dependencies + if: steps.node-modules-cache.outputs.cache-hit != 'true' + run: | + npm ci + working-directory: ./frontend + - name: Build + run: npm run build + working-directory: ./frontend + # - name: Send status to Slack + # # Third-party action, pin to commit SHA! + # # See https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions + # uses: digitalservicebund/notify-on-failure-gha@814d0c4b2ad6a3443e89c991f8657b10126510bf # v1.5.0 + # if: ${{ failure() && github.ref == 'refs/heads/main' }} + # with: + # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} unit-tests-frontend: runs-on: ubuntu-latest