ci(deps): Bump the actions group across 1 directory with 2 updates #154
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: {} | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| changes: | |
| name: Detect Changes | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| outputs: | |
| code: ${{ steps.filter.outputs.code }} | |
| frontend: ${{ steps.filter.outputs.frontend }} | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check for code changes | |
| id: filter | |
| run: | | |
| BASE_REF="${{ github.event.pull_request.base.sha || github.event.before || 'HEAD~1' }}" | |
| if [ "$BASE_REF" = "0000000000000000000000000000000000000000" ]; then | |
| BASE_REF="HEAD~1" | |
| fi | |
| CHANGED=$(git diff --name-only "$BASE_REF" HEAD) | |
| if [ -z "$CHANGED" ]; then | |
| echo "code=false" >> "$GITHUB_OUTPUT" | |
| elif echo "$CHANGED" | grep -qvE '^(docs/|\.lighthouse/|\.vscode/|\.DS_Store$|LICENSE$|CNAME$)|\.md$'; then | |
| echo "code=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "code=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| if echo "$CHANGED" | grep -qE '^(src/|public/|astro\.config\.mjs)'; then | |
| echo "frontend=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "frontend=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| build: | |
| name: Build | |
| needs: changes | |
| if: needs.changes.outputs.code == 'true' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup Bun environment | |
| uses: ./.github/actions/setup-bun | |
| - name: Build | |
| run: bun run build | |
| lighthouse: | |
| needs: changes | |
| if: needs.changes.outputs.frontend == 'true' | |
| uses: ./.github/workflows/_lighthouse.yml | |
| permissions: | |
| contents: write | |
| issues: write | |
| with: | |
| url: http://localhost:3000 | |
| local-server: true | |
| save-history: false |