-
Notifications
You must be signed in to change notification settings - Fork 6
52 lines (40 loc) · 1.1 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
name: ci-workflow
on: [push]
jobs:
# Run on push on all branches
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./...
# Run on push on main branch only and require unit-test job success
deploy-frontend:
needs: test
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 18.x
- name: Build code
run: npm ci && npm run build
env:
VUE_APP_API_URL: ${{ secrets.VUE_APP_API_URL }}
- name: Deploy resources to Netlify
run: npx netlify-cli deploy --prod --dir=./dist
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}