Skip to content

Commit 3b0f1a9

Browse files
committed
feat(actions): update deployment.yaml
1 parent ee32d6b commit 3b0f1a9

1 file changed

Lines changed: 41 additions & 13 deletions

File tree

.github/workflows/deploy.yaml

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,60 @@
1-
name: Deploy to GitHub Pages
1+
# .github/workflows/deploy.yml
2+
name: Build and Deploy to GitHub Pages
23

34
on:
45
push:
5-
branches:
6-
- main
6+
branches: [ main ]
7+
pull_request:
8+
branches: [ main ]
9+
10+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
17+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
18+
concurrency:
19+
group: "pages"
20+
cancel-in-progress: false
721

822
jobs:
9-
build-and-deploy:
23+
# Build job
24+
build:
1025
runs-on: ubuntu-latest
11-
1226
steps:
13-
- name: Checkout repository
14-
uses: actions/checkout@v3
27+
- name: Checkout
28+
uses: actions/checkout@v4
1529

1630
- name: Setup Node.js
17-
uses: actions/setup-node@v3
31+
uses: actions/setup-node@v4
1832
with:
1933
node-version: '18'
34+
cache: 'npm'
2035

2136
- name: Install dependencies
2237
run: npm ci
2338

2439
- name: Build project
2540
run: npm run build
2641

27-
- name: Deploy to GitHub Pages
28-
uses: peaceiris/actions-gh-pages@v4
42+
- name: Setup Pages
43+
uses: actions/configure-pages@v4
44+
45+
- name: Upload artifact
46+
uses: actions/upload-pages-artifact@v3
2947
with:
30-
github_token: ${{ secrets.GITHUB_TOKEN }}
31-
publish_dir: ./dist
32-
publish_branch: gh-pages
48+
path: './dist'
49+
50+
# Deployment job
51+
deploy:
52+
environment:
53+
name: github-pages
54+
url: ${{ steps.deployment.outputs.page_url }}
55+
runs-on: ubuntu-latest
56+
needs: build
57+
steps:
58+
- name: Deploy to GitHub Pages
59+
id: deployment
60+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)