Release scheduling

Course material can be released automatically by combining a publication schedule with a recurring GitHub Actions build. The scheduled-docs-profiles extension decides which documents are drafts at render time; GitHub Actions renders the project regularly and deploys the result to GitHub Pages.

This page uses an exercise profile for learner-facing material and a solution profile for answer-bearing material. For more background, see Quarto profiles, Quarto extensions, and GitHub Pages & Actions.

Publication flow

flowchart LR
    A["Hourly GitHub Actions run"] --> B["Render exercise profile"]
    B --> C["Evaluate exercise schedule"]
    C --> D["Render solution profile"]
    D --> E["Evaluate solution schedule"]
    E --> F["Deploy combined site to GitHub Pages"]

Scheduling a document does not cause GitHub Pages to update by itself. The recurring workflow is what rebuilds the site after a release time has passed.

Install the extensions

From the Quarto project directory, install the scheduling extension and the solution filters used by the project:

quarto install extension au-mbg/quarto-teaching-tools/extensions/scheduled-docs-profiles
quarto install extension au-mbg/quarto-teaching-tools/extensions/callout-solution
quarto install extension au-mbg/quarto-teaching-tools/extensions/strip-solution

The commands install files below _extensions/. Commit that directory so local and GitHub Actions builds use the same extension versions. A project only needs both solution filters when it uses both authoring patterns shown below.

Configure the Quarto project

The base _quarto.yml enables the filters, hides draft pages from the published website, and loads the metadata generated by the scheduling extension:

project:
  type: website

profile:
  group:
    - [exercise, solution]

website:
  title: "Course website"
  draft-mode: gone

metadata-files:
  - scheduled-docs_files/draft-list.yml

filters:
  - callout-solution
  - strip-solution

Set the output directory and solution visibility explicitly in each profile. The exercise site is written to the root of _site; solutions are added below _site/solution.

# _quarto-exercise.yml
project:
  output-dir: _site

teaching:
  show-solutions: false
# _quarto-solution.yml
project:
  output-dir: _site/solution

teaching:
  show-solutions: true
  default-solution-title: "Solution"

The profile group makes exercise and solution mutually exclusive. Always pass the intended profile in publication commands rather than relying on a developer’s most recently used profile.

Create release calendars

Use _schedule.yml as the exercise calendar. The extension looks for _schedule-<profile>.yml first and falls back to _schedule.yml when a profile-specific file does not exist. The exercise profile therefore uses the base calendar in this example:

# _schedule.yml
scheduled-docs:
  draft-after: "system-time"
  timezone: "+01:00"
  docs:
    - href: exercises/week-01.qmd
      date: "2026-09-07"
    - href: exercises/week-02.qmd
      date: "2026-09-14"
    - href: exercises/review.qmd
      date: "2099-01-01"
      draft: false

Create _schedule-solution.yml when solutions should follow a different calendar:

# _schedule-solution.yml
scheduled-docs:
  draft-after: "system-time"
  timezone: "+01:00"
  docs:
    - href: exercises/week-01.qmd
      date: "2026-09-08"
    - href: exercises/week-02.qmd
      date: "2026-09-15"
    - href: exercises/review.qmd
      date: "2026-09-20"
      draft: true

Each href is relative to the Quarto project directory. Dates use ISO YYYY-MM-DD format and take effect at midnight in the configured fixed-offset timezone. Use the offset that should apply on the release date; fixed offsets do not adjust automatically for daylight-saving time.

Normally, keep draft-after: "system-time". A future document is treated as a draft. An explicit draft: false publishes a document regardless of its future date, while draft: true withholds it regardless of a past date.

Separate calendars allow an exercise to appear before its worked solution. If _schedule-solution.yml is absent, the solution profile falls back to _schedule.yml and both versions follow the same dates.

Combine scheduling with exercises and solutions

Scheduling controls whether the complete page is published. The solution filters control which parts of a published page appear in each profile.

Use a solution callout for an instructor or solution-only explanation:

::: {.callout-solution title="Worked solution"}
The completed calculation goes here.
:::

Use paired blocks when the two versions need different content:

::: {teaching="exercise"}
Complete the calculation.
:::

::: {teaching="solution"}
The completed calculation and explanation.
:::

The same markers work on executable code cells:

```{python}
#| teaching: exercise
#| eval: false
# Complete this function.
```

```{python}
#| teaching: solution
def answer():
    return 42
```

The exercise profile keeps exercise blocks and removes solution blocks; the solution profile does the reverse. Setting teaching.show-solutions explicitly is important because filtering content based only on a profile name is less clear and less portable.

Add local render tasks

Define a Pixi task that renders both outputs in the same order used by the publication workflow:

[tasks.render]
args = [{ "arg" = "profile", default = "exercise",
          choices = ["exercise", "solution"] }]
cmd = "quarto render --profile {{profile}}"

[tasks.render-all]
cmd = "quarto render --profile exercise && quarto render --profile solution"
depends-on = ["clean"]

[tasks.clean]
cmd = "rm -rf _site .quarto"

Run pixi run render-all before publishing to inspect the same combined output that GitHub Pages will receive. Serve _site with a local web server when checking links between the root site and /solution/.

For authoring, use quarto preview --profile exercise or quarto preview --profile solution. Quarto preview makes drafts visible and can reuse previously generated HTML, so it does not reproduce the public release state. Use a clean production render to verify whether scheduled pages will actually be deployed.

Rebuild and deploy on a schedule

Create .github/workflows/publish.yml with push, manual, and scheduled triggers:

name: Build and publish website

on:
  push:
    branches: [main]
  workflow_dispatch:
  schedule:
    - cron: "17 3 * * *"

permissions:
  contents: read
  pages: write
  id-token: write

concurrency:
  group: pages
  cancel-in-progress: false

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: prefix-dev/setup-pixi@v0.9.4
        with:
          pixi-version: v0.80.0
          cache: true

      - run: pixi run render-all

      - name: Upload Pages artifact
        uses: actions/upload-pages-artifact@v3
        with:
          path: _site

  deploy:
    needs: build
    runs-on: ubuntu-latest
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    steps:
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v4
1
This line defines the cron schedule.

GitHub interprets the cron expression in UTC. This example requests one run per day at 03.17. Scheduled workflows can be delayed during periods of high load, so an eligible page normally appears during the next successful build rather than at an exact minute. Choose a cadence appropriate for the course; more frequent builds consume more Actions minutes.

Under the repository’s Settings → Pages, set the deployment source to GitHub Actions. Run the workflow manually once and inspect its build and deployment jobs before relying on the schedule.

Warning

Publishing solutions below /solution/ separates the two versions for navigation and scheduling, but it does not restrict access. Anyone who knows or discovers the URL can open the solution site. Do not publish confidential or access-controlled answer material this way.

Check a scheduled release

Before the course begins:

  1. Confirm that every scheduled href matches a source document.
  2. Run pixi run render-all and inspect both _site and _site/solution.
  3. Check that exercise and solution dates use the intended timezone and ordering.
  4. Trigger the GitHub Actions workflow manually and inspect the deployed site.
  5. After a scheduled date passes, confirm that the next workflow run succeeds and that the expected page appears.

When a release does not appear, first inspect the Actions run, then reproduce pixi run render-all locally. Common causes are a missing schedule entry, an incorrect href, invalid YAML, a render failure, or a GitHub Pages artifact path that does not match the configured output directory.