|
| 1 | +# .github/workflows/deploy.yml |
| 2 | + |
| 3 | +name: Deploy Quarto Website |
| 4 | + |
| 5 | +# Run on pushes to the main branch and allow manual runs |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: [main] # Or master, depending on your default branch name |
| 9 | + workflow_dispatch: |
| 10 | + |
| 11 | +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
| 12 | +permissions: |
| 13 | + contents: read # Need read to check out the code |
| 14 | + pages: write # Need write to deploy to GitHub Pages |
| 15 | + id-token: write # Need for OIDC token authentication for deployment |
| 16 | + |
| 17 | +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. |
| 18 | +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. |
| 19 | +concurrency: |
| 20 | + group: "pages" |
| 21 | + cancel-in-progress: false |
| 22 | + |
| 23 | +jobs: |
| 24 | + build-and-deploy: |
| 25 | + runs-on: ubuntu-latest # Use the latest Ubuntu runner |
| 26 | + |
| 27 | + steps: |
| 28 | + - name: Checkout repository |
| 29 | + uses: actions/checkout@v4 # Checks out your repository code |
| 30 | + |
| 31 | + - name: Set up Quarto |
| 32 | + uses: quarto-dev/quarto-cli-action@v2 |
| 33 | + with: |
| 34 | + # Optional: Specify a Quarto version, or leave blank for latest |
| 35 | + # version: 1.4.549 |
| 36 | + version: latest |
| 37 | + |
| 38 | + # Optional: Add steps here to install R, Python, or other dependencies |
| 39 | + # if your Quarto documents require code execution. |
| 40 | + # Example for Python: |
| 41 | + # - name: Set up Python |
| 42 | + # uses: actions/setup-python@v5 |
| 43 | + # with: |
| 44 | + # python-version: '3.11' # Specify your Python version |
| 45 | + # - name: Install Python dependencies |
| 46 | + # run: pip install -r requirements.txt # If you have a requirements file |
| 47 | + |
| 48 | + - name: Render Quarto Website |
| 49 | + run: quarto render # Renders the website, output goes to docs/ |
| 50 | + |
| 51 | + - name: Setup Pages |
| 52 | + id: pages # Used for referencing outputs later |
| 53 | + uses: actions/configure-pages@v5 # Configures GitHub Pages options |
| 54 | + |
| 55 | + - name: Upload artifact |
| 56 | + uses: actions/upload-pages-artifact@v3 # Uploads the rendered site content |
| 57 | + with: |
| 58 | + # Upload the entire contents of the output directory |
| 59 | + path: ./docs |
| 60 | + |
| 61 | + - name: Deploy to GitHub Pages |
| 62 | + id: deployment |
| 63 | + uses: actions/deploy-pages@v4 # Deploys the artifact to GitHub Pages |
| 64 | + # This action automatically handles authentication using the GITHUB_TOKEN |
0 commit comments