Skip to content

Commit 7d39ded

Browse files
authored
Update GitHub Actions workflow for deployment
1 parent 69ba3e2 commit 7d39ded

File tree

1 file changed

+19
-31
lines changed

1 file changed

+19
-31
lines changed

.github/workflows/deploy.yml

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Deploy to GitHub Pages
33
on:
44
push:
55
branches: [ main ]
6-
workflow_dispatch:
6+
workflow_dispatch:
77

88
permissions:
99
contents: read
@@ -14,42 +14,30 @@ jobs:
1414
build:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- name: Checkout repository
18-
uses: actions/checkout@v5
19-
20-
- name: Set up Node.js
21-
uses: actions/setup-node@v3
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
- name: Setup Node
20+
uses: actions/setup-node@v4
2221
with:
23-
node-version: 20 # or whichever Node version you want
24-
22+
node-version: '18'
2523
- name: Install dependencies
26-
run: |
27-
cd project
28-
npm ci
29-
30-
- name: Build Astro site
31-
run: |
32-
cd project
33-
npm run build
34-
35-
- name: Upload build artifacts
36-
uses: actions/upload-artifact@v4
24+
run: npm install
25+
working-directory: ./project
26+
- name: Build
27+
run: npm run build
28+
working-directory: ./project
29+
- name: Upload artifact
30+
uses: actions/upload-pages-artifact@v3
3731
with:
38-
name: github-pages
39-
path: project/dist # default Astro build output
32+
path: ./project/dist
4033

4134
deploy:
4235
needs: build
4336
runs-on: ubuntu-latest
37+
environment:
38+
name: github-pages
39+
url: ${{ steps.deployment.outputs.page_url }}
4440
steps:
45-
- name: Download build artifacts
46-
uses: actions/download-artifact@v4
47-
with:
48-
name: github-pages
49-
path: dist
50-
51-
- name: Deploy to GitHub Pages
41+
- name: Deploy to GitHub Pages
42+
id: deployment
5243
uses: actions/deploy-pages@v4
53-
id: deployment
54-
with:
55-
folder: dist

0 commit comments

Comments
 (0)