-
Notifications
You must be signed in to change notification settings - Fork 2
63 lines (54 loc) · 1.63 KB
/
publish.yml
File metadata and controls
63 lines (54 loc) · 1.63 KB
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
# name of the action
name: publish
# trigger on push events with branch main
on:
push:
branches: [ main ]
# pipeline to execute
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: clone
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v4.3.1
with:
# ensures we fetch tag history for the repository
fetch-depth: 0
- name: install go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
# use version from go.mod file
go-version-file: 'go.mod'
cache: true
check-latest: true
- name: build
env:
GOOS: linux
CGO_ENABLED: '1'
run: |
make build
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: cargill/vela-aws-credentials
tags: |
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
# set tag for github tag events
type=ref,event=tag,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
- name: Build and push image
uses: docker/build-push-action@v6
with:
push: true
sbom: true
context: .
provenance: mode=max
tags: ${{ steps.meta.outputs.tags }}