Deploy to GitHub Pages #1219
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: Deploy to GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| # Rebuild every hour (at the top of every hour). Picks up new entries | |
| # from the public Google Calendar and the glossary Sheet since the last build. | |
| schedule: | |
| - cron: '0 * * * *' | |
| # Manual trigger from the Actions tab — handy for pushing calendar | |
| # updates before the next scheduled run. | |
| workflow_dispatch: | |
| # Only one deploy at a time. A cron run and a push landing together | |
| # would otherwise race each other on the github-pages environment. | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| name: Build Docusaurus | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Cache Docusaurus build | |
| uses: actions/cache@v4 | |
| with: | |
| path: .docusaurus | |
| key: ${{ runner.os }}-docusaurus-${{ hashFiles('**/package-lock.json', '**/docusaurus.config.js') }} | |
| restore-keys: | | |
| ${{ runner.os }}-docusaurus- | |
| - name: Build website | |
| run: npm run build | |
| env: | |
| # Public CSV URL of the glossary Google Sheet. Set this as a repo | |
| # Variable (Settings > Secrets and variables > Actions > Variables) | |
| # named GLOSSARY_SHEET_CSV_URL. If unset, the committed JSON is used. | |
| GLOSSARY_SHEET_CSV_URL: ${{ vars.GLOSSARY_SHEET_CSV_URL }} | |
| - name: Upload Build Artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: build | |
| deploy: | |
| name: Deploy to GitHub Pages | |
| needs: build | |
| # Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
| permissions: | |
| pages: write # to deploy to Pages | |
| id-token: write # to verify the deployment originates from an appropriate source | |
| # Deploy to the github-pages environment | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |