Skip to content

Commit 90d5288

Browse files
committed
deploy github pages automatically
1 parent d165387 commit 90d5288

1 file changed

Lines changed: 18 additions & 9 deletions

File tree

‎.github/workflows/update-about.yml‎

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,35 @@
1-
# Stamp about.json on gh-pages with the time and commit of every push.
2-
# Runs for pushes to master and gh-pages; its own push (as github-actions[bot]
3-
# via GITHUB_TOKEN) does not re-trigger workflows, so it cannot loop.
4-
name: Update about.json
1+
# Publish the committed web assets and metadata to GitHub Pages.
2+
name: Deploy GitHub Pages
53

64
on:
75
push:
8-
branches: [master, gh-pages]
6+
branches: [master]
97

108
concurrency:
11-
group: update-about
9+
group: deploy-github-pages
1210
cancel-in-progress: false
1311

1412
jobs:
15-
update-about:
13+
deploy:
1614
runs-on: ubuntu-latest
1715
permissions:
1816
contents: write
1917
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
ref: ${{ github.sha }}
21+
path: source
22+
2023
- uses: actions/checkout@v4
2124
with:
2225
ref: gh-pages
26+
path: pages
27+
28+
- name: Copy web assets
29+
run: cp -R source/web/. pages/
2330

2431
- name: Stamp about.json
32+
working-directory: pages
2533
run: |
2634
node -e '
2735
const fs = require("fs")
@@ -32,11 +40,12 @@ jobs:
3240
'
3341
3442
- name: Commit and push
43+
working-directory: pages
3544
run: |
3645
git config user.name "github-actions[bot]"
3746
git config user.email "github-actions[bot]@users.noreply.github.com"
38-
git add about.json
47+
git add --all
3948
git diff --cached --quiet || {
40-
git commit -m "Stamp about.json for ${GITHUB_SHA::7}"
49+
git commit -m "Deploy website for ${GITHUB_SHA::7}"
4150
git push
4251
}

0 commit comments

Comments
 (0)