Skip to content

Commit fef4fc5

Browse files
committed
feat: Deploy to gh-pages branch instead of using GitHub Pages artifacts
1 parent b092fda commit fef4fc5

File tree

1 file changed

+7
-19
lines changed

1 file changed

+7
-19
lines changed

.github/workflows/deploy.yml

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,11 @@ on:
66
- main
77

88
permissions:
9-
contents: read
10-
pages: write
11-
id-token: write
9+
contents: write # Allow writing to the repo (pushing gh-pages branch)
1210

1311
jobs:
1412
build-and-deploy:
1513
runs-on: ubuntu-latest
16-
environment:
17-
name: github-pages
18-
url: ${{ steps.deployment.outputs.page_url }}
1914

2015
steps:
2116
- name: Checkout repository
@@ -24,27 +19,20 @@ jobs:
2419
- name: Set up Node.js
2520
uses: actions/setup-node@v4
2621
with:
27-
node-version: '23' # Specify your Node.js version
22+
node-version: '23'
2823
cache: 'npm'
2924

3025
- name: Install dependencies
3126
run: npm ci # Use ci for cleaner installs in CI
3227

3328
- name: Build project
34-
run: npm build
29+
run: npm run build
3530

3631
- name: Build SVGs
3732
run: node public/dist/cli.js public/pinouts
3833

39-
- name: Setup Pages
40-
uses: actions/configure-pages@v5
41-
42-
- name: Upload artifact
43-
uses: actions/upload-pages-artifact@v3
34+
- name: Deploy to gh-pages branch
35+
uses: peaceiris/actions-gh-pages@v4
4436
with:
45-
# Upload entire directory
46-
path: './public'
47-
48-
- name: Deploy to GitHub Pages
49-
id: deployment
50-
uses: actions/deploy-pages@v4
37+
github_token: ${{ secrets.GITHUB_TOKEN }}
38+
publish_dir: ./public

0 commit comments

Comments
 (0)