Skip to content

Commit c271ae6

Browse files
committed
ci(quarto_publish): add action
1 parent 6b5495b commit c271ae6

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Render quarto site and publish on GitHub pages
2+
run-name: Render quarto site and publish on GitHub pages
3+
4+
on:
5+
push:
6+
branches: main
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-deploy:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
steps:
15+
- name: Check out repository
16+
uses: actions/checkout@v4
17+
18+
- name: Ensure gh-pages branch exists
19+
run: |
20+
if ! git ls-remote --heads origin gh-pages >/dev/null 2>&1; then
21+
echo "gh-pages does not exist, creating from main"
22+
git branch gh-pages
23+
git push origin gh-pages
24+
else
25+
echo "gh-pages already exists, nothing to do"
26+
fi
27+
28+
- name: Set up Quarto
29+
uses: quarto-dev/quarto-actions/setup@v2
30+
31+
- name: Render and publish to GitHub pages
32+
uses: quarto-dev/quarto-actions/publish@v2
33+
with:
34+
target: gh-pages
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)