Example GitHub Action

Example GitHub Action that deploys Quarto
.gitub/workflows/publish.yml
on:
1  workflow_dispatch:
  pull_request:
  push:
    branches: release-prod

name: Quarto Publish

jobs:
  build-deploy:
    runs-on: ubuntu-latest
    steps:
2      - uses: actions/setup-python@v4
        with:
          python-version: '3.10'
          
      - name: install nbformat for ipynb filter
        run: pip install nbformat==5.7.3
        
3      - name: Check out repository
        uses: actions/checkout@v3

      - name: Set up Quarto
        uses: quarto-dev/quarto-actions/setup@v2
        with:
4          version: "1.2.475"

5      - name: Render
        uses: quarto-dev/quarto-actions/render@v2
        with:
          to: html

6      - name: Deploy to GitHub Pages
        if: github.event_name != 'pull_request'
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./_site
          cname: yoursite.com
1
Trigger the action on push, pull request, or manually
2
Set up Python and install nbformat
3
Check out the repository
4
Pin the version of Quarto to use
5
Render the site
6
Publish the site to GitHub Pages