-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (45 loc) · 1.29 KB
/
deploy.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
name: Deploy website
on:
push:
branches:
- master
- main
paths:
- .knosys/sites/default/**
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
env:
SITE_REPO: ourairyu/pro
SITE_BRANCH: gh-pages
steps:
- name: Create temp dirs
run: mkdir site-src site-dist
- uses: actions/checkout@v3
with:
path: site-src
- uses: actions/checkout@v3
with:
repository: ${{ env.SITE_REPO }}
ref: ${{ env.SITE_BRANCH }}
persist-credentials: false
path: site-dist
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 14.15.3
- run: cd site-src && npm i && npm run deploy ../site-dist && cd ..
- name: Commit changes
run: |
cd site-dist
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "chore: update via GitHub Actions"
- uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GH_TOKEN }}
repository: ${{ env.SITE_REPO }}
branch: ${{ env.SITE_BRANCH }}
directory: site-dist