-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (47 loc) · 1.54 KB
/
ci_cd.yaml
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
name: build, test and deploy
on: [push, pull_request]
jobs:
test:
# In order to avoid running this with 'mob next'
if: "!contains(github.event.head_commit.message, 'skip-ci')"
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install yarn
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies and build web app
run: make build-web
- name: Install golang
uses: actions/setup-go@v3
with:
go-version: 1.19.0 # Same version as set in Dockerfile
# - name: Run linters
# uses: golangci/golangci-lint-action@v2
- name: Run tests
run: make coverage
- name: Prepare coverage report
uses: jandelgado/[email protected]
- name: Send coverage report
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.lcov
deploy:
# Only run this in case building and testing succeeded and the event is a push to master
if: "${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}"
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # do a full, so not a shallow, clone
- name: Push to dokku
uses: dokku/[email protected]
with:
git_push_flags: "--force"
git_remote_url: "ssh://[email protected]:22/cassette"
ssh_private_key: ${{ secrets.DOKKU_SSH_PRIVATE_KEY }}