Skip to content

Commit 2c256a3

Browse files
committed
Refactor GitHub Actions workflow to deploy site directly to gh-pages branch and update permissions
1 parent 63f8a2c commit 2c256a3

1 file changed

Lines changed: 8 additions & 12 deletions

File tree

.github/workflows/deploy-pages.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,21 @@ on:
66
- main
77

88
permissions:
9-
contents: read
9+
contents: write
1010
pages: write
1111
id-token: write
1212

1313
jobs:
14-
build:
14+
deploy:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout repository
1818
uses: actions/checkout@v4
1919

20-
- name: Upload site folder for Pages
21-
uses: actions/upload-pages-artifact@v2
20+
- name: Deploy to gh-pages branch
21+
uses: peaceiris/actions-gh-pages@v3
2222
with:
23-
path: ./site
24-
25-
deploy:
26-
needs: build
27-
runs-on: ubuntu-latest
28-
steps:
29-
- name: Deploy to GitHub Pages
30-
uses: actions/deploy-pages@v1
23+
publish_dir: ./site
24+
# Use the default GITHUB_TOKEN provided by Actions
25+
publish_branch: gh-pages
26+
keep_files: false

0 commit comments

Comments
 (0)