Skip to content

Commit 66a7faa

Browse files
committed
different approach
Signed-off-by: Nick Cameron <nrc@ncameron.org>
1 parent 3f75d40 commit 66a7faa

1 file changed

Lines changed: 18 additions & 13 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@ on:
55
branches: [ "main" ]
66

77
jobs:
8-
deploy:
8+
build:
99
runs-on: ubuntu-latest
10-
permissions:
11-
contents: write
12-
pull-requests: write
1310
steps:
1411
- uses: actions/checkout@v6
1512
with:
@@ -26,14 +23,22 @@ jobs:
2623
- name: Deploy GitHub Pages
2724
run: |
2825
mdbook build
29-
git worktree add gh-pages
30-
git config user.name "Deploy from CI"
31-
git config user.email ""
26+
mkdir gh-pages
3227
cd gh-pages
33-
# Delete the ref to avoid keeping history.
34-
git update-ref -d refs/heads/gh-pages
35-
rm -rf *
3628
mv ../book/* .
37-
git add .
38-
git commit -m "Deploy $GITHUB_SHA to gh-pages"
39-
git push --force --set-upstream origin gh-pages
29+
- name: Upload static files as artifact
30+
id: deployment
31+
uses: actions/upload-pages-artifact@v5
32+
with:
33+
path: gh-pages/
34+
deploy:
35+
needs: build
36+
runs-on: ubuntu-latest
37+
permissions:
38+
pages: write
39+
environment:
40+
name: github-pages
41+
url: ${{ steps.deployment.outputs.page_url }}
42+
steps:
43+
- id: deployment
44+
uses: actions/deploy-pages@v5

0 commit comments

Comments
 (0)