-
Notifications
You must be signed in to change notification settings - Fork 11
53 lines (51 loc) · 1.35 KB
/
ci.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
name: CI
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
jobs:
test:
runs-on: ubuntu-20.04
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "1.22"
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./...
build:
runs-on: ubuntu-20.04
needs: test
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get Vars
id: get_vars
run: |
echo "ts=$(date +%s)" >> $GITHUB_OUTPUT
echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "branch=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_OUTPUT
- name: Build Kannon
uses: ./.github/actions/build-docker
with:
docker-target: kannon
branch: ${{ steps.get_vars.outputs.branch }}
sha: ${{ steps.get_vars.outputs.sha }}
ts: ${{ steps.get_vars.outputs.ts }}
push: ${{ github.ref == 'refs/heads/main' }}