Build & Publish Quarto site → GitHub Pages #84
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: Build & Publish Quarto site → GitHub Pages | |
| on: | |
| push: | |
| branches: [main] | |
| schedule: | |
| - cron: "0 2 * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write # needed by deploy-pages | |
| id-token: write # needed by deploy-pages | |
| env: | |
| ORCID_ID: ${{ secrets.ORCID_ID || '0000-0001-9162-262X' }} | |
| OPENALEX_USER_AGENT: "acangi.github.io (mailto:attila.cangi@gmail.com)" | |
| SKIP_OPENALEX: "0" | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # 1 Checkout | |
| - uses: actions/checkout@v4 | |
| # 2 Enable Pages (extracts metadata, sets env vars) | |
| - uses: actions/configure-pages@v4 | |
| # 3 Install Quarto | |
| - uses: quarto-dev/quarto-actions/setup@v2 | |
| # 4 Python deps for BibTeX → YAML | |
| - name: Install Python packages | |
| run: | | |
| python -m pip install --upgrade pip pyyaml requests pyiso4 | |
| # 5 Harvest publications from OpenAlex | |
| - name: Harvest publications from OpenAlex | |
| run: python scripts/openalex_to_yaml.py | |
| # Install Node.js and Sass | |
| - name: Install Node.js and Sass | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - run: npm install -g sass | |
| # 6 Render the Quarto site | |
| - name: Render site | |
| run: quarto render | |
| # 7 Upload the built site as a Pages artifact | |
| - name: Upload GitHub Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: _site | |
| # 8 Deploy to Pages | |
| - name: Deploy to GitHub Pages | |
| uses: actions/deploy-pages@v4 |