-
Notifications
You must be signed in to change notification settings - Fork 3
37 lines (35 loc) · 1.04 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
name: deploy
# This workflow is triggered on pushes to the repository.
on: [push]
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
CI_USER_EMAIL: [email protected]
CI_USER_NAME: GH_Action
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up node
uses: actions/setup-node@master
- name: Installing project dependencies
run: |
npm install
- name: Check lint
run: |
npm run lint
- if: github.ref == 'refs/heads/master'
name: Deploy to github pages
run: |
echo "building dist"
npm run build
echo "switching directory to /dist"
cd ./dist
git init
echo "setting git config"
git config user.email "${{ env.CI_USER_EMAIL }}"
git config user.name "${{ env.CI_USER_NAME }}"
git add -A
git commit -m "deploy"
git push -f https://${{ env.GH_TOKEN }}@github.com/andythsu/WaterlooStudies.git master:gh-pages