-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (58 loc) · 2.13 KB
/
Copy pathdeploy-github-pages.yml
File metadata and controls
67 lines (58 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
on:
workflow_dispatch:
push:
branches: main
schedule:
# Every day at 8am
- cron: "0 8 * * *"
name: Deploy to Github Pages
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
build-deploy:
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- name: Install pak
run: install.packages("pak")
shell: Rscript {0}
# Detect every package the site (including the synced modules) depends on,
# instead of hardcoding a list, so newly added modules using new packages
# work without editing this workflow. pak installs the system requirements
# (e.g. those mapgl needs: gdal/geos/proj/...) automatically on this runner.
- name: Install R dependencies
run: |
deps <- pak::scan_deps(".")
pkgs <- setdiff(unique(deps$package), "R")
pak::pak(pkgs)
shell: Rscript {0}
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Render and Publish
uses: quarto-dev/quarto-actions/publish@v2
with:
target: gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Modules use `freeze: auto`, so the render above re-executes only the
# modules whose source changed and reuses the committed freeze for the rest.
# Push that refreshed freeze to main so the next render reuses it
# instead of recomputing the same modules every time. Pushes made with
# GITHUB_TOKEN do not trigger workflows, so this does not loop.
- name: Commit refreshed module freeze
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add _freeze
git diff --cached --quiet && echo "No freeze changes" && exit 0
git commit -m "chore: update module freeze [skip ci]"
git push