Skip to content

Commit 222b05e

Browse files
committed
fix: deploy workflow
1 parent 86872d4 commit 222b05e

File tree

1 file changed

+44
-27
lines changed

1 file changed

+44
-27
lines changed

.github/workflows/main.yml

Lines changed: 44 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,51 @@
1-
name: Deploy to GitHub Pages
1+
# Simple workflow for deploying static content to GitHub Pages
2+
name: Deploy static content to Pages
23

34
on:
5+
# Runs on pushes targeting the default branch
46
push:
5-
branches: [ main ]
6-
pull_request:
7-
branches: [ main ]
7+
branches: ['main']
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow one concurrent deployment
19+
concurrency:
20+
group: 'pages'
21+
cancel-in-progress: true
822

923
jobs:
10-
build-and-deploy:
24+
# Single deploy job since we're just deploying
25+
deploy:
26+
environment:
27+
name: github-pages
28+
url: ${{ steps.deployment.outputs.page_url }}
1129
runs-on: ubuntu-latest
12-
1330
steps:
14-
- name: Checkout
15-
uses: actions/checkout@v4
16-
17-
- name: Setup Node.js
18-
uses: actions/setup-node@v4
19-
with:
20-
node-version: '24'
21-
cache: 'npm'
22-
23-
- name: Install dependencies
24-
run: npm i
25-
26-
- name: Build
27-
run: npm run build
28-
29-
- name: Deploy to GitHub Pages
30-
uses: peaceiris/actions-gh-pages@v3
31-
if: github.ref == 'refs/heads/main'
32-
with:
33-
github_token: ${{ secrets.GITHUB_TOKEN }}
34-
publish_dir: ./dist
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
- name: Set up Node
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: lts/*
37+
cache: 'npm'
38+
- name: Install dependencies
39+
run: npm ci
40+
- name: Build
41+
run: npm run build
42+
- name: Setup Pages
43+
uses: actions/configure-pages@v5
44+
- name: Upload artifact
45+
uses: actions/upload-pages-artifact@v3
46+
with:
47+
# Upload dist folder
48+
path: './dist'
49+
- name: Deploy to GitHub Pages
50+
id: deployment
51+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)