-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (52 loc) · 1.33 KB
/
ci.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
name: CI
on:
push:
branches:
- 'feat/**'
- 'ci/**'
- 'issue/**'
- 'master'
- 'staging'
- 'hotfix/**'
- 'bug/**'
- 'fix/**'
- 'refactor/**'
- 'build/**'
- 'test/**'
- 'dependabot/**'
jobs:
test:
name: Run Tests 🔬
runs-on: ubuntu-latest
steps:
- name: Checkout 📥
uses: actions/[email protected]
- name: Get yarn cache 📦
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/[email protected]
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
node-version: '12'
- run: yarn install
- run: yarn test --passWithNoTests
deploy:
name: Release 🚀
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/master'
needs:
- test
steps:
- name: Checkout Repository
uses: actions/[email protected]
- name: Release 📌
if: "github.event_name == 'push'"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release