-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (50 loc) · 1.61 KB
/
BuildPage.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
# This is a basic workflow to help you get started with Actions
name: Build and push
# Controls when the action will run.
on:
# Triggers the workflow on push and pull request events
push:
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.121.2'
extended: true
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '14'
- run: npm install
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Enable Configuration
run: cp config.toml.${{ steps.extract_branch.outputs.branch }} config.toml
- name: Build Page
run: |
mv static/css/app.css themes/paper/assets/custom.css
npm run build
- name: Deploy to Staging
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/staging' }}
with:
personal_token: ${{ secrets.PERSONAL_TOKEN }}
external_repository: koneko096/staging
publish_branch: master
- name: Deploy to Live
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/source' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: master