Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .devcontainer/quarto-1.10/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "1.10 - Quarto Codespaces",
"image": "ghcr.io/mcanouil/quarto-codespaces:latest",
"remoteUser": "vscode",
"features": {
"ghcr.io/rocker-org/devcontainer-features/quarto-cli:1": {
"version": "1.10"
}
},
"customizations": {
"vscode": {
"extensions": [
"quarto.quarto",
"mcanouil.quarto-wizard",
"REditorSupport.r",
"ms-python.python",
"julialang.language-julia",
"ms-python.black-formatter",
"ms-python.flake8",
"ms-python.vscode-pylance",
"ms-python.pylint",
"ms-python.isort",
"ms-toolsai.jupyter",
"Posit.air-vscode"
],
"settings": {
"r.rterm.option": ["--no-save", "--no-restore-data", "--quiet"],
"r.useRenvLibPath": true,
"[r]": {
"editor.defaultFormatter": "Posit.air-vscode",
"editor.formatOnSave": true
}
}
}
}
}
39 changes: 27 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
paths:
- "docs/**"
- ".github/workflows/deploy.yml"
pull_request:
paths:
- "docs/**"
- ".github/workflows/deploy.yml"
release:
types: [ published ]

Expand All @@ -17,24 +21,22 @@ permissions:
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
deploy:
build:
runs-on: ubuntu-latest
name: Deploy - Documentation website

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
name: Build - Documentation website

steps:
- name: Setup Git user
uses: mcanouil/quarto-workflows/.github/actions/setup-git-user@main
id: setup-git-user
with:
gh-app-id: ${{ vars.APP_ID }}
# Pull requests from forks cannot read the app key, so fall back to
# the workflow token there; nothing is pushed from this workflow.
gh-app-id: ${{ github.event_name != 'pull_request' && vars.APP_ID || '' }}
app-key: ${{ secrets.APP_KEY }}
gh-token: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -53,17 +55,30 @@ jobs:
working-directory: ./docs
run: quarto render .

- name: Prepare site for deployment
run: touch docs/_site/.nojekyll

- name: Configure GitHub Pages
if: github.event_name != 'pull_request'
uses: actions/configure-pages@v6

- name: Upload Pages artifact
if: github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@v5
with:
path: "./docs/_site"

deploy:
runs-on: ubuntu-latest
name: Deploy - Documentation website

needs:
- "build"

if: github.event_name != 'pull_request'

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5
101 changes: 60 additions & 41 deletions .github/workflows/devcontainer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ jobs:
permissions:
contents: write

env:
TARGET_FILE: docs/reference/quarto-check.qmd

steps:
- name: Checkout repository
uses: actions/checkout@v7
Expand Down Expand Up @@ -265,13 +268,20 @@ jobs:
env:
BUILD_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{
github.run_id }}
TARGET_FILE: docs/reference/quarto-check.qmd
run: |
update_docs_section() {
local version=$1
local output_file=$2
local build_url=$3

# An empty transcript would be committed as an empty code block, so
# fail loudly when the artifact is missing rather than silently
# publishing a blank section.
if [ ! -s "${output_file}" ]; then
echo "::error::Missing or empty quarto check output: ${output_file}"
return 1
fi

# Normalise version for marker tags
local version_upper
version_upper=$(echo "${version}" | tr '[:lower:]' '[:upper:]')
Expand All @@ -286,16 +296,19 @@ jobs:
local temp_file
temp_file=$(mktemp)

# Update quarto check output section. The transcript is read from
# the file inside awk rather than passed with -v, because a
# multi-line -v value is not portable across awk variants. The
# blank lines around the injected block are required: without them
# Replace both marked sections in a single pass. The transcript is
# read from the file inside awk rather than passed with -v, because
# a multi-line -v value is not portable across awk variants. The
# blank lines around each injected block are required: without them
# Pandoc reads the code fence as part of the HTML comment block.
awk -v start="${output_start}" \
-v end="${output_end}" \
-v outfile="${output_file}" '
awk -v output_start="${output_start}" \
-v output_end="${output_end}" \
-v url_start="${url_start}" \
-v url_end="${url_end}" \
-v outfile="${output_file}" \
-v url="${build_url}" '
BEGIN { in_block=0 }
index($0, start) {
index($0, output_start) {
print $0
print ""
print "```txt"
Expand All @@ -309,36 +322,23 @@ jobs:
in_block=1
next
}
index($0, end) {
print $0
in_block=0
next
}
!in_block { print }
' "${TARGET_FILE}" > "${temp_file}"

# Update build URL section
awk -v start="${url_start}" \
-v end="${url_end}" \
-v url="${build_url}" '
BEGIN { in_block=0 }
index($0, start) {
index($0, url_start) {
print $0
print ""
print "[View build log](" url ")"
print ""
in_block=1
next
}
index($0, end) {
index($0, output_end) || index($0, url_end) {
print $0
in_block=0
next
}
!in_block { print }
' "${temp_file}" > "${TARGET_FILE}"
' "${TARGET_FILE}" > "${temp_file}"

rm -f "${temp_file}"
mv "${temp_file}" "${TARGET_FILE}"

echo "Updated ${version} section in ${TARGET_FILE}"
}
Expand All @@ -352,7 +352,6 @@ jobs:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
BRANCH: "ci/update-quarto-check-docs"
COMMIT: "ci: update quarto check outputs in documentation"
TARGET_FILE: docs/reference/quarto-check.qmd
run: |
if git show-ref --quiet refs/heads/${BRANCH}; then
echo "Branch ${BRANCH} already exists."
Expand All @@ -371,10 +370,9 @@ jobs:
sleep 2
gh pr merge --auto --squash --delete-branch

build-versions:
list-versions:
runs-on: ubuntu-latest

name: Build - Quarto ${{ matrix.QUARTO_VERSION }}
name: List - Version-pinned configurations

needs:
- "merge"
Expand All @@ -387,21 +385,42 @@ jobs:
always() && needs.merge.result == 'success' && needs.update-docs.result
== 'success'

outputs:
versions: ${{ steps.versions.outputs.versions }}

steps:
- uses: actions/checkout@v7

# Derive the matrix from the repository so that adding a
# .devcontainer/quarto-<version>/ directory is the only step needed to
# build a new version.
- name: Collect version-pinned configurations
id: versions
run: |
VERSIONS=$(find .devcontainer -mindepth 1 -maxdepth 1 -type d -name 'quarto-[0-9]*' \
-exec basename {} \; | sed 's/^quarto-//' | sort -V | jq -R . | jq -sc .)

if [ "${VERSIONS}" = "[]" ]; then
echo "::error::No version-pinned configurations found under .devcontainer/"
exit 1
fi

echo "Versions: ${VERSIONS}"
echo "versions=${VERSIONS}" >> "${GITHUB_OUTPUT}"

build-versions:
runs-on: ubuntu-latest

name: Build - Quarto ${{ matrix.QUARTO_VERSION }}

needs:
- "list-versions"

strategy:
matrix:
PLATFORM:
- "linux/amd64"
QUARTO_VERSION:
- "1.0"
- "1.1"
- "1.2"
- "1.3"
- "1.4"
- "1.5"
- "1.6"
- "1.7"
- "1.8"
- "1.9"
QUARTO_VERSION: ${{ fromJSON(needs.list-versions.outputs.versions) }}
steps:
- uses: actions/checkout@v7

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ docker pull ghcr.io/mcanouil/quarto-codespaces:latest
| `latest` | stable release | `amd64`, `arm64` |
| `release`, `release-noble` | stable release | `amd64`, `arm64` |
| `prerelease`, `prerelease-noble` | prerelease | `amd64`, `arm64` |
| `1.0` … `1.9`, `1.0-noble` … `1.9-noble` | that minor version | `amd64` |
| one per Quarto minor version, with a `-noble` variant | that minor version | `amd64` |
| any tag with a `-<YYYYMMDDHHMM>` suffix | as above, pinned to one build | as above |

Images are rebuilt every Sunday and scanned with [Trivy](https://trivy.dev/).
Expand All @@ -47,7 +47,7 @@ Full tag list: [`ghcr.io/mcanouil/quarto-codespaces`](https://github.com/mcanoui
}
```

Configurations for the Quarto prerelease and for every minor version from `1.0` to `1.9` are in [`.devcontainer/`](.devcontainer).
Configurations for the Quarto prerelease and for every supported Quarto minor version are in [`.devcontainer/`](.devcontainer), and listed on the [configurations](https://m.canouil.dev/quarto-codespaces/reference/configurations.html) page.
Click **Use this template** to start your own repository from this one.

## Documentation
Expand Down
2 changes: 1 addition & 1 deletion docs/_brand.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ color:
palette:
midnight: "#0B1220"
midnight-2: "#111C2E"
slate: "#1B2942"
frost: "#F5F7FA"
ink: "#16202E"
mist: "#DCE3EC"
mist-muted: "#8EA0B8"
amber: "#E8A33D"
amber-deep: "#A25E0C"
background:
Expand Down
1 change: 1 addition & 0 deletions docs/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ format:
- assets/stylesheets/theme.scss

filters:
- assets/filters/devcontainer-configurations.lua
- at: post-quarto
path: gitlink

Expand Down
Loading