Skip to content

Commit 20f6888

Browse files
authored
Refactor GitHub Actions workflow for deployment
1 parent a946eae commit 20f6888

1 file changed

Lines changed: 23 additions & 18 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,37 @@
1-
name: Deploy to GitHub Pages
1+
name: Deploy
22

33
on:
44
push:
55
branches: [main]
66

7-
permissions:
8-
contents: write
9-
107
jobs:
11-
deploy:
8+
build:
129
runs-on: ubuntu-latest
13-
1410
steps:
15-
- name: checkout code
16-
uses: actions/checkout@v3
17-
18-
- name: set up node
19-
uses: actions/setup-node@v3
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-node@v3
2013
with:
21-
node-version: 18
22-
23-
- name: install dependencies
14+
node-version: '18'
15+
- name: Install dependencies
2416
run: npm install
25-
26-
- name: build
17+
- name: Run build
2718
run: npm run build
28-
29-
- name: deploy
19+
- uses: actions/upload-artifact@v3
20+
with:
21+
name: dist
22+
path: ./dist
23+
24+
deploy:
25+
needs: [build]
26+
runs-on: ubuntu-latest
27+
permissions:
28+
contents: write
29+
steps:
30+
- uses: actions/download-artifact@v3
31+
with:
32+
name: dist
33+
path: ./dist
34+
- name: Deploy
3035
uses: peaceiris/actions-gh-pages@v3
3136
with:
3237
github_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)