-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (39 loc) · 1.18 KB
/
deploy.yaml
File metadata and controls
47 lines (39 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Build and Deploy
on:
push:
branches:
- main # Trigger the workflow on push to the main branch
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
- name: Install dependencies
run: yarn install
- name: Build Next.js project
run: yarn build
- name: Upload static site as artifact
uses: actions/upload-artifact@v4
with:
name: artifact
path: dist
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: artifact
path: dist
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist # The folder containing your static files
publish_branch: gh-pages # Deploy to the gh-pages branch
force_orphan: true # Create an orphan branch if it doesn't exist
keep_files: true