Pages #451
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: Pages | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| repository_dispatch: | |
| types: [org-repo-updated] | |
| schedule: | |
| - cron: '24 * * * *' | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| name: Build verified site | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6, node24 | |
| - name: Setup Node | |
| uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5, node24 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build, validate, and test | |
| run: npm run check | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install Chromium release dependency | |
| run: npx playwright install --with-deps chromium | |
| - name: Run browser and accessibility release checks | |
| run: npm run test:browser | |
| - name: Verify Pages artifact root and identity | |
| run: | | |
| test -s _site/index.html | |
| test -s _site/CNAME | |
| test "$(cat _site/CNAME)" = "interdependentway.org" | |
| test -d _site/pagefind | |
| test -s _site/build.json | |
| node -e "const b=require('./_site/build.json'); if(b.commit!==process.env.GITHUB_SHA) process.exit(1)" | |
| - name: Configure Pages | |
| uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6, node24 | |
| - name: Upload verified site artifact | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7, node24 | |
| with: | |
| name: verified-site-${{ github.sha }} | |
| path: _site | |
| retention-days: 30 | |
| if-no-files-found: error | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5, composite; internal upload-artifact v7 | |
| with: | |
| path: _site | |
| deploy: | |
| name: Deploy and verify site | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Checkout verification script | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6, node24 | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5, node24 | |
| - name: Verify Pages deployment identity | |
| run: node scripts/verify-live-deployment.mjs "${{ steps.deployment.outputs.page_url }}" "${{ github.sha }}" | |
| - name: Verify custom-domain deployment identity | |
| run: node scripts/verify-live-deployment.mjs "https://interdependentway.org" "${{ github.sha }}" |