-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (47 loc) · 1.5 KB
/
build.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
name: build
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.18.x
- uses: actions/setup-node@v1
with:
node-version: "16"
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- uses: actions/cache@v2
with:
path: |
ui/node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-node_modules-
- uses: actions/checkout@v2
- run: (cd ui && yarn)
- run: (cd ui && yarn build)
- run: go install github.com/deepmap/oapi-codegen/cmd/oapi-codegen@v1.11.0
- run: go generate ./...
- run: go test ./...
- run: go build
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.46
- if: startsWith(github.ref, 'refs/tags/v')
run: echo "$DOCKER_PASS" | docker login --username "$DOCKER_USER" --password-stdin
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASS: ${{ secrets.DOCKER_PASS }}
- if: startsWith(github.ref, 'refs/tags/v')
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --skip-validate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}