-
Notifications
You must be signed in to change notification settings - Fork 0
118 lines (103 loc) · 3.54 KB
/
Copy pathquarto-render.yml
File metadata and controls
118 lines (103 loc) · 3.54 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: Quarto Render
on:
workflow_call:
inputs:
action-runs-on:
description: 'The type of runner to run the job on'
required: false
default: 'ubuntu-latest'
type: string
ref:
description: 'Git ref to checkout (branch or SHA)'
required: true
default: 'release'
type: string
git-user-name:
required: false
type: string
default: 'FacsimiLab Bot'
git-user-email:
required: false
type: string
default: '195262995+facsimilab-bot@users.noreply.github.com'
quarto-profile:
description: 'The Quarto profile to use for rendering'
required: false
type: string
quarto-output-dir:
description: 'The output directory for the rendered Quarto site'
required: false
default: '_site'
type: string
publish-branch:
required: false
type: string
default: 'gh-pages'
secrets:
SSH_PRIVATE_KEY:
required: false
SSH_PUBLIC_KEY:
required: false
permissions:
contents: write
jobs:
quarto-render:
runs-on: ${{ inputs.action-runs-on }}
steps:
- name: Check out repository
uses: actions/checkout@v6.0.1
with:
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
fetch-depth: 1
ref: ${{ github.sha }}
- name: Setup | Force correct release branch on workflow SHA
run: |
git checkout -B ${{ github.ref_name }}
- name: Checkout central workflows
uses: actions/checkout@v6.0.1
with:
repository: FacsimiLab/central-workflows
path: .central-workflows
- name: Set up SSH agent
uses: webfactory/ssh-agent@v0.9.1
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Convert HTTPS remote to SSH
run: |
HTTPS_URL=$(git remote get-url origin)
if [[ "$HTTPS_URL" == https://github.com/* ]]; then
SSH_URL=$(echo "$HTTPS_URL" | sed -E 's#https://github.com/#git@github.com:#')
git remote set-url origin "$SSH_URL"
fi
git remote -v
- name: Install GH CLI
uses: dev-hanz-ops/install-gh-cli-action@v0.2.1
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Check for Quarto installation
run: quarto --version || exit 1
# If the previous step failed, install Quarto
- name: Set up Quarto
if: ${{ failure() }}
uses: quarto-dev/quarto-actions/setup@v2
with:
tinytex: true
- name: Create Python venv
run: |
bash .central-workflows/.github/workflows/scripts/setup-venv.sh
echo "PYTHONPATH=$(pwd)/.venv/bin" >> $GITHUB_ENV
echo "$(pwd)/.venv/bin" >> $GITHUB_PATH
- name: Render Quarto Project
run: |
uv run render.py || bash .central-workflows/scripts/quarto/quarto-render.sh "${{ inputs.quarto-profile }}"
- name: Configure Git
run: |
git config --global user.name ${{ inputs.git-user-name }}
git config --global user.email ${{ inputs.git-user-email }}
git config --global user.signingkey "${{ secrets.SSH_PUBLIC_KEY }}"
git config --list
- name: Commit rendered files to branch gh-pages
run: |
git config user.name "FacsimiLab Bot"
echo "Using ${{ inputs['quarto-output-dir'] }} for gh-pages"
bash .central-workflows/scripts/static-site/static-site-git.sh ${{ inputs['quarto-output-dir'] }}