Skip to content

Commit 332efdc

Browse files
committed
modernize GH actions
1 parent 7f4e29e commit 332efdc

2 files changed

Lines changed: 33 additions & 15 deletions

File tree

.github/workflows/gh-pages.yml

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,47 @@ permissions:
1515
pages: write
1616
id-token: write
1717

18-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
18+
# Allow only one concurrent deployment
2019
concurrency:
2120
group: 'pages'
2221
cancel-in-progress: false
2322

2423
jobs:
25-
# Single deploy job since we're just deploying
26-
deploy:
27-
environment:
28-
name: github-pages
29-
url: ${{ steps.deployment.outputs.github_pages_url }}
24+
build:
3025
runs-on: ubuntu-latest
3126
steps:
3227
- name: Checkout
3328
uses: actions/checkout@v4
34-
- name: Setup Pages
35-
uses: actions/configure-pages@v5
36-
- name: Vite Github Pages Deployer
37-
uses: skywarth/vite-github-pages-deployer@v1.4.0
38-
id: deployment
29+
30+
- name: Setup Node
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: 20
34+
cache: 'yarn'
35+
36+
- name: Install dependencies
37+
run: yarn install
38+
39+
- name: Build Sitemap
40+
run: yarn build-sitemap
41+
42+
- name: Build
43+
run: yarn build
3944
env:
4045
VITE_ENV: production
46+
47+
- name: Upload artifact
48+
uses: actions/upload-pages-artifact@v3
4149
with:
42-
public_base_path: '/'
43-
package_manager: 'yarn'
50+
path: dist
51+
52+
deploy:
53+
environment:
54+
name: github-pages
55+
url: ${{ steps.deployment.outputs.page_url }}
56+
runs-on: ubuntu-latest
57+
needs: build
58+
steps:
59+
- name: Deploy to GitHub Pages
60+
id: deployment
61+
uses: actions/deploy-pages@v4

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"lint": "eslint -c eslint.config.js",
1212
"lint:fix": "eslint -c eslint.config.js --fix",
1313
"format": "prettier --write src/",
14-
"prebuild": "npm run build-sitemap",
14+
"prebuild": "yarn build-sitemap",
1515
"build-sitemap": "tsx src/sitemap/sitemap.ts"
1616
},
1717
"dependencies": {

0 commit comments

Comments
 (0)