Skip to content

Commit 4107932

Browse files
Merge pull request #90 from Promptly-Technologies-LLC/35-automate-the-documentation-rendering-and-publishing
35 automate the documentation rendering and publishing
2 parents cdd1470 + 6a4eaad commit 4107932

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

.github/workflows/publish.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Publish Documentation
2+
3+
on:
4+
push:
5+
branches: main
6+
7+
jobs:
8+
publish-documentation:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
id-token: write
12+
contents: write
13+
steps:
14+
- name: Generate token for version incrementer app
15+
id: create_token
16+
uses: tibdex/github-app-token@v2
17+
with:
18+
app_id: ${{ secrets.APP_ID }}
19+
private_key: ${{ secrets.PRIVATE_KEY }}
20+
21+
- name: Check out repository
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
ref: ${{ github.sha }}
26+
token: ${{ steps.create_token.outputs.token }}
27+
28+
- name: Install uv
29+
uses: astral-sh/setup-uv@v5
30+
31+
- name: "Set up Python"
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version-file: "pyproject.toml"
35+
36+
- name: Install dependencies
37+
run: uv sync
38+
39+
- name: Set up Quarto
40+
uses: quarto-dev/quarto-actions/setup@v2
41+
42+
- name: Configure Git
43+
run: |
44+
git config --global user.name "github-actions[bot]"
45+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
46+
47+
- name: Render and Publish
48+
run: uv run quarto publish gh-pages --no-prompt --no-browser
49+
50+
- name: Render Documentation
51+
run: |
52+
# Publish Quarto documentation
53+
quarto publish --no-prompt --no-browser
54+
55+
# Render README in GitHub Flavored Markdown
56+
quarto render index.qmd --output-dir . --output README.md --to gfm
57+
58+
# Remove index.html if it exists
59+
rm -f index.html
60+
61+
- name: Commit version change
62+
uses: stefanzweifel/git-auto-commit-action@v5
63+
with:
64+
commit_message: "Update README"
65+
branch: ${{ github.ref_name }}
66+
file_pattern: "README.md"

0 commit comments

Comments
 (0)