-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (53 loc) · 1.67 KB
/
main.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
53
54
55
56
57
58
59
60
61
62
63
64
name: Build
on:
- push
env:
REGISTRY: ghcr.io
DOCKER_BUILDKIT: 1
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build & test app
id: test
run: |
make test
- name: Check
uses: dominikh/staticcheck-action@v1.3.1
- name: Scan for Vulnerabilities in Code
uses: Templum/govulncheck-action@v0.10.1
with:
go-version: 1.19
vulncheck-version: latest
package: ./...
fail-on-vuln: true
- name: Lint Dockerfile
uses: hadolint/hadolint-action@v2.1.0
with:
dockerfile: Dockerfile
config: hadolint.yaml
- name: Set hash
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
platforms: linux/arm64,linux/amd64
tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ steps.vars.outputs.sha_short }}
build-args: VERSION=${{ steps.vars.outputs.sha_short }}
labels: BUILDDATE=${{ github.event.repository.updated_at}},VERSION=${{ steps.vars.outputs.sha_short }}
context: .
cache-from: type=gha
cache-to: type=gha,mode=max