-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (52 loc) · 1.79 KB
/
deploy-next.yml
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Github pages overwrite
run-name: Deploy client build to GH Pages
on:
push:
branches:
- "prod"
paths:
- "client/**"
# NOTE: You may want to limit the trigger branch to be "main" or "master" etc.
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
pull-requests: write
repository-projects: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3
- name: Generate your content
run: echo "Optional placeholder. Put your project's static website generator command here."
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 18
- name: Install dependencies
run: cd client && npm install
- name: Build static website
run: cd client && npm run build
- name: Publish current workdir (which contains generated content) to GitHub Pages
uses: rayluo/github-pages-overwriter@v1.3
with:
# Optional. Default value "." means the root directory of your project will be published.
# You can use whatever directory your project uses, for example "wwwroot".
# Such a directory does *not* have to already exist in your repo,
# it could be an output directory created dynamically by your static website builder.
source-directory: client/out
# Optional. Default value "gh-pages".
# It specifies the temporary branch which hosts the static website.
# Each build will OVERWRITE this branch.
# target-branch: gh-pages-test
deploy:
environment: github-pages
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2