-
Notifications
You must be signed in to change notification settings - Fork 10
47 lines (45 loc) · 1.32 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
name: k2d-ci
on:
push:
branches:
- "develop"
- "!release/*"
pull_request:
branches:
- "develop"
- "release/*"
- "feat/*"
- "fix/*"
- "refactor/*"
jobs:
build_images:
runs-on: ubuntu-latest
steps:
- name: "[preparation] checkout the current branch"
uses: actions/[email protected]
- name: "[preparation] set up golang 1.23.3"
uses: actions/[email protected]
with:
go-version: "1.23.3"
cache-dependency-path: ./go.sum
- name: "[preparation] set up qemu"
uses: docker/setup-qemu-action@v2
- name: "[preparation] set up docker context for buildx"
run: docker context create builders
- name: "[preparation] set up docker buildx"
uses: docker/setup-buildx-action@v2
with:
endpoint: builders
- name: "[preparation] docker login"
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: "[execution] build k2d and build docker images"
run: |
if [ "${GITHUB_EVENT_NAME}" == "pull_request" ]; then
CONTAINER_IMAGE_TAG="pr${{ github.event.number }}"
else
CONTAINER_IMAGE_TAG="${GITHUB_REF_NAME}"
fi
make image-multiarch VERSION=${CONTAINER_IMAGE_TAG}