Skip to content

Commit 81e11d3

Browse files
committed
ci: updated deployment workflow
1 parent 8f0c24e commit 81e11d3

File tree

1 file changed

+41
-31
lines changed

1 file changed

+41
-31
lines changed

.github/workflows/deploy.yml

Lines changed: 41 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,62 @@
1-
name: Deploy
1+
# Simple workflow for deploying static content to GitHub Pages
2+
name: Deploy to Pages
23

34
on:
5+
# Runs on pushes targeting the default branch
46
push:
5-
branches:
6-
- main
7+
branches: ['main']
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow one concurrent deployment
19+
concurrency:
20+
group: 'pages'
21+
cancel-in-progress: true
722

823
jobs:
24+
# Single deploy job since we're just deploying
925
deploy:
26+
environment:
27+
name: github-pages
28+
url: ${{ steps.deployment.outputs.page_url }}
1029
runs-on: ubuntu-latest
1130
steps:
12-
- uses: actions/checkout@v4
13-
with:
14-
fetch-depth: 0
31+
- name: Checkout
32+
uses: actions/checkout@v5
1533

16-
- uses: actions/setup-node@v4
34+
- name: Set up Node
35+
uses: actions/setup-node@v6
1736
with:
18-
registry-url: https://registry.npmjs.org/
19-
node-version: 20
37+
node-version: lts/*
2038

2139
- uses: pnpm/action-setup@v4
2240
name: Install pnpm
23-
id: pnpm-install
2441
with:
25-
version: 9
26-
run_install: false
27-
28-
- name: Get pnpm store directory
29-
id: pnpm-cache
30-
shell: bash
31-
run: |
32-
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
33-
34-
- uses: actions/cache@v3
35-
name: Setup pnpm cache
36-
with:
37-
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
38-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
39-
restore-keys: |
40-
${{ runner.os }}-pnpm-store-
42+
version: 10
43+
cache: true
4144

4245
- name: Install dependencies
4346
run: pnpm install
4447

4548
- name: Build
46-
run: pnpm build
49+
run: pnpm run build
50+
51+
- name: Setup Pages
52+
uses: actions/configure-pages@v5
4753

48-
- name: Deploy
49-
uses: peaceiris/actions-gh-pages@v3
54+
- name: Upload artifact
55+
uses: actions/upload-pages-artifact@v4
5056
with:
51-
github_token: ${{ secrets.GITHUB_TOKEN }}
52-
publish_dir: ./dist
57+
# Upload dist folder
58+
path: './dist'
59+
60+
- name: Deploy to GitHub Pages
61+
id: deployment
62+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)