forked from robertabcd/PttChrome
-
Notifications
You must be signed in to change notification settings - Fork 4
51 lines (51 loc) · 2.15 KB
/
deploy-ghpage.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
name: Build and Deploy
on:
workflow_call:
inputs:
CNAME: { required: true, type: string }
DEFAULT_SITE: { required: true, type: string }
DEV_PROXY_TARGET: { required: true, type: string }
DEV_PROXY_HEADER: { required: true, type: string }
deploy-repository-name:
default: '${{ github.repository_owner }}/${{ github.repository }}'
required: false
type: string
deploy-branch:
default: gh-pages
required: false
type: string
secrets:
deploy-token: { required: true }
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@master # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
with:
persist-credentials: false
- uses: actions/setup-node@v4
- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
run: |
yarn
yarn build
echo "$CNAME" > dist/CNAME
env:
CNAME: ${{ inputs.CNAME }}
PTTCHROME_THEME: 'ccns'
PTTCHROME_PAGE_TITLE: PttChrome-CCNS
DEFAULT_SITE: ${{ inputs.DEFAULT_SITE }}
ALLOW_SITE_IN_QUERY: "yes"
DEV_PROXY_TARGET: ${{ inputs.DEV_PROXY_TARGET }}
DEV_PROXY_HEADER: ${{ inputs.DEV_PROXY_HEADER }}
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
GITHUB_REPOSITORY: ${{ github.repository }}
NODE_OPTIONS: '--openssl-legacy-provider'
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.deploy-token }}
repository-name: ${{ inputs.deploy-repository-name }}
branch: ${{ inputs.deploy-branch }} # The branch the action should deploy to.
folder: dist # The folder the action should deploy.
clean: true # Automatically remove deleted files from the deploy branch