-
Notifications
You must be signed in to change notification settings - Fork 3
93 lines (82 loc) · 2.42 KB
/
build-and-publish.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
on:
pull_request:
branches:
- main
push:
branches:
- "main"
tags:
- "v*.*.*"
jobs:
build-kots-lint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '^1.19.3'
- name: setup env
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
shell: bash
- run: make test build
env:
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
goreleaser:
runs-on: ubuntu-latest
needs: build-kots-lint
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Unshallow
run: git fetch --prune --unshallow
- uses: actions/setup-go@v4
with:
go-version: '^1.19.3'
- run: sudo apt-get -qq -y install
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: "v0.166.1"
args: release --rm-dist --config deploy/.goreleaser.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
docker:
runs-on: ubuntu-latest
needs: build-kots-lint
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- uses: docker/build-push-action@v4
with:
push: true
tags: replicated/kots-lint:${{ github.ref_name }}
flyio:
runs-on: ubuntu-latest
needs: build-kots-lint
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v3
- uses: superfly/[email protected]
with:
args: deploy --app kots-lint --config ./fly.toml --image-label ${GITHUB_REF:10}
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
flyio-dd-agent:
runs-on: ubuntu-latest
needs: flyio
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v3
- uses: superfly/[email protected]
with:
args: deploy --config ./dd-fly.toml --app dd-agent -e DD_API_KEY=${{ secrets.DD_API_KEY }} -e DD_SITE="datadoghq.com" -e DD_APM_NON_LOCAL_TRAFFIC=true
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}