-
Notifications
You must be signed in to change notification settings - Fork 10
66 lines (56 loc) · 1.59 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Deploy
on:
push:
branches: ['develop', 'master']
pull_request:
branches: ['develop', 'master']
jobs:
cancel-previous:
name: 'Cancel Previous Runs'
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
deploy:
runs-on: ubuntu-latest
needs: cancel-previous
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.GH_PUSH_TOKEN }}
- uses: actions/setup-node@v2-beta
with:
node-version: '16.10.0'
registry-url: https://registry.npmjs.org/
- name: Set npm credentials
run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
- name: Install package
run: npm ci
- name: Build package
run: npm run build
- name: Eslint validation
run: npm run lint
- name: Npm Run Test
run: npm run test
- name: Publish ${{ github.ref }}
uses: codfish/semantic-release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_PUSH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
sync_development_with_master:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
needs: deploy
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: develop
token: ${{ secrets.GH_PUSH_TOKEN }}
- name: Merge master into develop branch
run: |
git merge origin/master
git push origin develop