-
Notifications
You must be signed in to change notification settings - Fork 6
53 lines (52 loc) · 1.4 KB
/
pr.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
name: Pull request
on:
pull_request:
branches:
- main
jobs:
vet:
name: Vet
runs-on: ubuntu-latest
concurrency:
group: ${{ github.head_ref }}-vet
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup asdf
uses: asdf-vm/actions/install@v3
- name: Install dependencies
run: go mod download
- name: Add asdf shims to PATH
run: |
echo "${HOME}/.asdf/shims" >> $GITHUB_PATH
- name: Lint
run: go vet ./...
- name: Run tests
run: go test -v ./...
image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Docker buildx
uses: docker/[email protected]
- name: Extract Docker metadata
id: meta
uses: docker/[email protected]
with:
images: |
ghcr.io/flexstack/new-dockerfile
- name: Build and push Docker image
id: build-and-push
uses: docker/[email protected]
with:
context: .
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max