Skip to content

Commit abdd305

Browse files
committed
ci: add GHA workflow
1 parent 34506d4 commit abdd305

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed

.github/workflows/render.yaml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
schedule:
9+
# run every day at 11:05 PM Pacific
10+
- cron: "5 7 * * *"
11+
workflow_dispatch:
12+
13+
name: render.yaml
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
# Only restrict concurrency for non-PR jobs
19+
concurrency:
20+
group: render-${{ github.event_name != 'pull_request' || github.run_id }}
21+
env:
22+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
23+
isExtPR: ${{ github.event.pull_request.head.repo.fork == true }}
24+
steps:
25+
26+
- name: Configure Git user
27+
run: |
28+
git config --global user.name "$GITHUB_ACTOR"
29+
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"
30+
31+
- uses: actions/checkout@v3
32+
33+
- uses: quarto-dev/quarto-actions/setup@v2
34+
35+
- uses: r-lib/actions/setup-r@v2
36+
with:
37+
use-public-rspm: true
38+
39+
- uses: r-lib/actions/setup-r-dependencies@v2
40+
41+
- name: Render book
42+
run: quarto render
43+
44+
- name: Deploy to GitHub Pages
45+
if: contains(env.isExtPR, 'false')
46+
id: gh-pages-deploy
47+
uses: JamesIves/github-pages-deploy-action@v4
48+
with:
49+
branch: gh-pages
50+
folder: _site
51+
52+
- name: Upload website artifact
53+
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' }}
54+
uses: actions/upload-pages-artifact@v3
55+
with:
56+
path: "_site"
57+
58+
deploy:
59+
needs: build
60+
61+
permissions:
62+
pages: write # to deploy to Pages
63+
id-token: write # to verify the deployment originates from an appropriate source
64+
65+
environment:
66+
name: github-pages
67+
url: ${{ steps.deployment.outputs.page_url }}
68+
69+
runs-on: ubuntu-latest
70+
steps:
71+
- name: Deploy to GitHub Pages
72+
id: deployment
73+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)