Skip to content

Commit c39d8a4

Browse files
author
Wess Cope
committed
Add Pages workflow to publish site/ to gh-pages
1 parent 345afd9 commit c39d8a4

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

‎.github/workflows/pages.yml‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Pages
2+
3+
# Publish the site/ folder to the gh-pages branch, which GitHub Pages serves
4+
# (legacy branch mode, with the account-level custom domain). Runs whenever the
5+
# site under site/ changes.
6+
7+
on:
8+
push:
9+
branches: [main]
10+
paths:
11+
- "site/**"
12+
- ".github/workflows/pages.yml"
13+
workflow_dispatch: {}
14+
15+
permissions:
16+
contents: write
17+
18+
concurrency:
19+
group: pages
20+
cancel-in-progress: true
21+
22+
jobs:
23+
publish:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v5
27+
- name: Publish site/ to gh-pages
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
run: |
31+
set -euo pipefail
32+
touch site/.nojekyll
33+
cd site
34+
git init -q -b gh-pages
35+
git config user.name "github-actions[bot]"
36+
git config user.email "github-actions[bot]@users.noreply.github.com"
37+
git add -A
38+
git commit -qm "Publish site from ${GITHUB_SHA}"
39+
git push -f "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" gh-pages

0 commit comments

Comments
 (0)