-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (44 loc) · 1.23 KB
/
deploy.yml
File metadata and controls
50 lines (44 loc) · 1.23 KB
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
name: Deploy
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-18.04
steps:
- name: Configuring git identity
run: |
git config --global user.email "mrc@tuture.co"
git config --global user.name mRcfps
- name: Checkout
uses: actions/checkout@v1
- name: Build
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Cache node modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- name: Install dependencies and build vuepress
run: |
yarn
yarn build
- name: Deploy
run: |
git checkout -b $BRANCH_NAME
node buildCodingPages.js
git add .
git commit -m "Automatic deploy (`date`)"
git remote add $REMOTE $CODING_REPO
git push -f -u $REMOTE $BRANCH_NAME
env:
REMOTE: coding
BRANCH_NAME: coding-pages
CODING_REPO: ${{ secrets.CODING_REPO }}