-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (59 loc) · 1.67 KB
/
push.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
name: push
on: push
permissions:
contents: read
id-token: write
jobs:
test:
runs-on: ubuntu-latest
env:
GO111MODULE: "on"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "1.18"
- run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go test -v -cover $(go list ./...)
build:
needs: test
runs-on: ubuntu-latest
env:
GO111MODULE: "on"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "1.18"
- run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/hermod-linux-amd64 .
- uses: actions/upload-artifact@v4
with:
name: bin
path: bin/
docker:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: bin
path: bin/
- name: Login to Quay.io
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- id: meta
uses: docker/metadata-action@v5
with:
images: quay.io/uswitch/hermod
tags: |
type=semver,pattern={{raw}}
type=sha,prefix=,format=long
- uses: docker/build-push-action@v6
with:
context: .
labels: ${{ steps.meta.outputs.labels }}
push: true
tags: ${{ steps.meta.outputs.tags }}