Skip to content

Commit 715e213

Browse files
authored
Update GitHub Actions workflow for static deployment
1 parent f2f731d commit 715e213

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

.github/workflows/static.yml

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
# Simple workflow for deploying static content to GitHub Pages
2-
name: Deploy static content to Pages
2+
name: Deploy browser build to GitHub Pages
33

44
on:
5-
# Runs on pushes targeting the default branch
65
push:
76
branches: ["main"]
8-
9-
# Allows you to run this workflow manually from the Actions tab
107
workflow_dispatch:
118

129
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1310
permissions:
14-
contents: read
15-
pages: write
16-
id-token: write
11+
contents: write
1712

1813
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
1914
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
@@ -22,22 +17,29 @@ concurrency:
2217
cancel-in-progress: false
2318

2419
jobs:
25-
# Single deploy job since we're just deploying
2620
deploy:
27-
environment:
28-
name: github-pages
29-
url: ${{ steps.deployment.outputs.page_url }}
3021
runs-on: ubuntu-latest
3122
steps:
3223
- name: Checkout
3324
uses: actions/checkout@v4
34-
- name: Setup Pages
35-
uses: actions/configure-pages@v5
36-
- name: Upload artifact
37-
uses: actions/upload-pages-artifact@v3
25+
26+
- name: Use Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: '20'
30+
cache: 'npm'
31+
cache-dependency-path: Build/package-lock.json
32+
33+
- name: Install dependencies
34+
working-directory: Build
35+
run: npm ci
36+
37+
- name: Build
38+
working-directory: Build
39+
run: npm run build
40+
41+
- name: Deploy browser build to GitHub Pages
42+
uses: peaceiris/actions-gh-pages@v4
3843
with:
39-
# Upload entire repository
40-
path: '.'
41-
- name: Deploy to GitHub Pages
42-
id: deployment
43-
uses: actions/deploy-pages@v4
44+
github_token: ${{ secrets.GITHUB_TOKEN }}
45+
publish_dir: Build/dist

0 commit comments

Comments
 (0)