Skip to content

Commit 339d67b

Browse files
Separate build from deploy
1 parent b2dbf01 commit 339d67b

File tree

3 files changed

+25
-348
lines changed

3 files changed

+25
-348
lines changed

.github/workflows/deploy.yml

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,41 @@ permissions:
1212
id-token: write
1313

1414
jobs:
15-
deploy:
15+
build:
16+
name: Build
1617
runs-on: ubuntu-latest
18+
1719
steps:
18-
- name: Checkout repository
20+
- name: Checkout repo
1921
uses: actions/checkout@v4
2022

21-
- name: Set up Node.js
23+
- name: Setup Node
2224
uses: actions/setup-node@v4
23-
with:
24-
node-version: 22
2525

2626
- name: Install dependencies
2727
run: npm install
2828

29-
- name: Build the project
29+
- name: Build project
3030
run: npm run build
3131

32-
- name: Configure Git
33-
run: |
34-
git config --global user.name "${{ github.actor }}"
35-
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
32+
- name: Upload production-ready build files
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: production-files
36+
path: ./dist
37+
38+
deploy:
39+
name: Deploy
40+
needs: build
41+
runs-on: ubuntu-latest
42+
if: github.ref == 'refs/heads/main'
43+
44+
steps:
45+
- name: Download artifact
46+
uses: actions/download-artifact@v4
47+
with:
48+
name: production-files
49+
path: ./dist
3650

3751
- name: Deploy to GitHub Pages
3852
uses: peaceiris/actions-gh-pages@v4

0 commit comments

Comments
 (0)