anielsen001 / quarto-github-pages-actions-example

Example project creating a website using github actions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GitHub actions quarto example

This is an example project that creates a website using GitHub actions with Quarto.

Create a quarto project

quarto create-project

Python code example

An executable python code example can be found in sources/python.qmd

Computation freeze

This example uses the code computation freeze directive.

Configure the repository to use gh-pages

The following command step quarto publish won't complete unless this is set up first.

Manually perform quarto publish

https://quarto.org/docs/publishing/github-pages.html#publish-action

quarto publish gh-pages

This may take a long time to run. The documentation says that this will create a file called _publish.yml but that did not happen for me (quarto version 1.2.269).

Instead, manually create a .github/workflows/publish.yml

mkdir -p .github/workflows
touch .github/workflows/publish.yml

and put the following into publish.yml (copied directory from quarto docs

on:
  workflow_dispatch:
  push:
    branches: main

name: Quarto Publish

jobs:
  build-deploy:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - name: Check out repository
        uses: actions/checkout@v3

      - name: Set up Quarto
        uses: quarto-dev/quarto-actions/setup@v2

      - name: Render and Publish
        uses: quarto-dev/quarto-actions/publish@v2
        with:
          target: gh-pages
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

References

About

Example project creating a website using github actions


Languages

Language:JavaScript 69.2%Language:HTML 28.5%Language:CSS 2.3%