Skip to content

Commit ea73a19

Browse files
committed
Update pages-cd workflow
1 parent 51cee5e commit ea73a19

1 file changed

Lines changed: 22 additions & 22 deletions

File tree

.github/workflows/pages-cd.yml

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

33
on:
44
push:
55
branches:
66
- main
77

8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: 'pages'
15+
cancel-in-progress: true
16+
817
jobs:
918
build:
10-
name: Build
1119
runs-on: ubuntu-latest
1220

1321
steps:
14-
- name: Checkout repo
22+
- name: Checkout repository
1523
uses: actions/checkout@v3
1624

17-
- name: Setup Node
25+
- name: Setup Node.js (Latest LTS)
1826
uses: actions/setup-node@v3
1927
with:
20-
node-version: 16
28+
node-version: 'lts/*'
2129

2230
- name: Install dependencies
23-
uses: bahmutov/npm-install@v1
31+
run: npm ci
2432

2533
- name: Build project
2634
run: npm run build
2735

28-
- name: Upload production-ready build files
29-
uses: actions/upload-artifact@v3
36+
- name: Upload build output
37+
uses: actions/upload-pages-artifact@v2
3038
with:
31-
name: production-files
3239
path: ./dist
3340

3441
deploy:
35-
name: Deploy
36-
needs: build
3742
runs-on: ubuntu-latest
38-
if: github.ref == 'refs/heads/main'
43+
needs: build
44+
environment:
45+
name: github-pages
46+
url: ${{ steps.deployment.outputs.page_url }}
3947

4048
steps:
41-
- name: Download artifact
42-
uses: actions/download-artifact@v3
43-
with:
44-
name: production-files
45-
path: ./dist
46-
4749
- name: Deploy to GitHub Pages
48-
uses: peaceiris/actions-gh-pages@v3
49-
with:
50-
github_token: ${{ secrets.GITHUB_TOKEN }}
51-
publish_dir: ./dist
50+
id: deployment
51+
uses: actions/deploy-pages@v2

0 commit comments

Comments
 (0)