generated from maehr/github-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Attach built Quarto site to release assets and add maintainer docs #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f0054f5
Initial plan
Copilot 2a3478d
Add release site upload workflow
Copilot f64c76a
Name renv setup step
Copilot c09c76d
Harden release workflow steps
Copilot edbdda2
Tweak release workflow messages
Copilot 69c3ff1
Remove template override step
Copilot e575f91
Add maintainer documentation
Copilot fcb6142
Refactor CI workflow and update documentation on archiving and artifacts
maehr c843f0c
Update maintainer and agent guidelines to include CITATION.cff and cl…
maehr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Maintainer Notes | ||
|
|
||
| ## Scope | ||
|
|
||
| - This is a template repo; keep placeholders like `USERNAME` and `REPO_NAME` intact. | ||
| - Avoid adding new dependencies unless necessary. | ||
|
|
||
| ## Routine Maintenance | ||
|
|
||
| - Update template guidance and placeholder instructions as needed. | ||
| - Format and lint before releases or larger edits: | ||
| - `npm run format` (or `npm run check` to verify) | ||
| - `uv run ruff format` and `uv run ruff check` | ||
| - `uv run ty check` (if applicable) | ||
| - R: `styler::style_dir(".")` and `lintr::lint_dir(".")` | ||
|
|
||
| ## Releases | ||
|
|
||
| - **Manual releases** (GitHub UI or `gh release create`) trigger `.github/workflows/release-site.yml` on `release: published`. | ||
| - The workflow renders the site and uploads `site.tar.gz` to the release. | ||
| - Do **not** run production Quarto commands (`quarto render` / `quarto publish gh-pages`) outside CI workflows. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| on: | ||
| release: | ||
| types: | ||
| - published | ||
|
|
||
| name: Build and Upload Release Site | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| build-release-site: | ||
| name: Build and Upload Release Site | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Check out repository | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Set up Quarto | ||
| uses: quarto-dev/quarto-actions/setup@v2 | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v6 | ||
|
|
||
| - name: Setup R | ||
| uses: r-lib/actions/setup-r@v2 | ||
| with: | ||
| r-version: renv | ||
| - name: Setup renv | ||
| uses: r-lib/actions/setup-renv@v2 | ||
|
|
||
| - name: Render Quarto Project | ||
| uses: quarto-dev/quarto-actions/render@v2 | ||
| with: | ||
| to: html | ||
|
|
||
| - name: JamPack Optimization | ||
| run: | | ||
| npx @divriots/jampack ./_site || { echo "JamPack optimization failed; check the previous command output for details." >&2; exit 1; } | ||
|
|
||
| - name: Archive site | ||
| run: | | ||
| if [ ! -d _site ]; then | ||
| echo "Missing _site directory; Quarto render did not produce output." >&2 | ||
| exit 1 | ||
| fi | ||
| tar -czf site.tar.gz _site | ||
|
|
||
| - name: Upload site archive to release | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| gh release upload "${{ github.event.release.tag_name }}" site.tar.gz --clobber | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the template repository itself (
maehr/open-research-data-template), this workflow renders using the templated_quarto.ymlinstead of the template-specific.github/_quarto.yml, so the archivedsite.tar.gzfor releases won’t match the site that GitHub Pages deploys fromquarto-publish.yml(which conditionally overwrites_quarto.yml). To keep the release archive consistent with the deployed documentation, consider adding a conditional “Overwrite _quarto.yml” step here mirroring the one in.github/workflows/quarto-publish.yml(guarded withif: github.repository == 'maehr/open-research-data-template') before the Quarto render step.