-
Notifications
You must be signed in to change notification settings - Fork 4
58 lines (50 loc) · 1.46 KB
/
cd.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
name: CD
on:
push:
branches:
- production
schedule:
# Translate the cron schedule into human-readable format: https://crontab.guru/
# every day at midnight
- cron: '0 0 * * *'
jobs:
cd:
runs-on: macos-latest # for the fonts in the OG image
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: production
- name: Setup node env
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install dependencies
run: yarn install --frozen-lockfile --network-timeout 100000
- name: Run linter
run: yarn run lint
- name: Build
run: yarn run build
- name: Push to dev & production branch
run: |
if [ -n "$(git diff --exit-code)" ]
then
git config user.name github-actions
git config user.email [email protected]
git fetch origin dev
git stash
git checkout dev
git stash pop
git add -A
git commit -m "feat: update the OG images & og-imgs-cache.json"
git push origin dev
git checkout production
git cherry-pick dev@{0}
git push origin production
fi
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
cname: about.disfactory.tw