Skip to content

Commit 126a6a5

Browse files
committed
Add GitHub Pages auto deploy
1 parent eefaada commit 126a6a5

File tree

1 file changed

+22
-24
lines changed

1 file changed

+22
-24
lines changed

.github/workflows/deploy.yml

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name: Deploy to GitHub Pages
1+
name: Deploy Next.js site to GitHub Pages
22

33
on:
44
push:
5-
branches: ["main"]
6-
workflow_dispatch:
5+
branches:
6+
- main
77

88
permissions:
99
contents: read
@@ -12,37 +12,35 @@ permissions:
1212

1313
concurrency:
1414
group: "pages"
15-
cancel-in-progress: false
15+
cancel-in-progress: true
1616

1717
jobs:
1818
build:
1919
runs-on: ubuntu-latest
20+
2021
steps:
21-
- name: Checkout
22-
uses: actions/checkout@v4
23-
- name: Setup Node
24-
uses: actions/setup-node@v4
22+
- uses: actions/checkout@v4
23+
24+
- uses: actions/setup-node@v4
2525
with:
26-
node-version: "20"
27-
cache: "npm"
28-
- name: Install dependencies
29-
run: npm ci
30-
- name: Build
31-
run: npm run build
32-
- name: Add .nojekyll
33-
run: touch out/.nojekyll
34-
- name: Upload artifact
35-
uses: actions/upload-pages-artifact@v3
26+
node-version: 18
27+
cache: npm
28+
29+
- run: npm ci
30+
- run: npm run build
31+
32+
- uses: actions/upload-pages-artifact@v3
3633
with:
37-
path: ./out
34+
path: out
3835

3936
deploy:
37+
needs: build
38+
runs-on: ubuntu-latest
39+
4040
environment:
4141
name: github-pages
4242
url: ${{ steps.deployment.outputs.page_url }}
43-
runs-on: ubuntu-latest
44-
needs: build
43+
4544
steps:
46-
- name: Deploy to GitHub Pages
47-
id: deployment
48-
uses: actions/deploy-pages@v4
45+
- id: deployment
46+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)