Skip to content

Commit 584197b

Browse files
committed
refactor(workflow): directly publish to github pages
1 parent 2066a20 commit 584197b

File tree

1 file changed

+25
-15
lines changed

1 file changed

+25
-15
lines changed

.github/workflows/deploy.yml

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,37 @@
1-
name: Deploy to GitHub Pages
1+
name: Deploy Astro site to GitHub Pages
22

33
on:
44
push:
55
branches:
66
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
713

814
jobs:
9-
build-and-deploy:
15+
build:
16+
name: Build
1017
runs-on: ubuntu-latest
11-
permissions:
12-
contents: write
13-
pages: write
1418
steps:
1519
- name: Checkout
16-
uses: actions/checkout@v3
17-
18-
- name: Install and Build
19-
run: |
20-
npm install
21-
npm run build
20+
uses: actions/checkout@v4
2221

23-
- name: Deploy
24-
uses: peaceiris/actions-gh-pages@v3
22+
- name: Setup & Build Astro
23+
uses: withastro/action@v4
2524
with:
26-
github_token: ${{ secrets.GITHUB_TOKEN }}
27-
publish_dir: ./dist
25+
package-manager: npm
26+
27+
deploy:
28+
name: Deploy
29+
runs-on: ubuntu-latest
30+
needs: build
31+
environment:
32+
name: github-pages
33+
url: ${{ steps.deployment.outputs.page_url }}
34+
steps:
35+
- name: Deploy to GitHub Pages
36+
id: deployment
37+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)