-
Notifications
You must be signed in to change notification settings - Fork 5
45 lines (42 loc) · 1.16 KB
/
build_push_daemon.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
name: Build and push daemon image
on:
push:
branches:
- v1.2.4
paths:
- daemon/**
- cni/**
- Makefile
env:
IMAGE_VERSION: '1.2.4'
DAEMON_REGISTRY: ghcr.io/${{ github.repository_owner }}
jobs:
build-push-daemon:
runs-on: ubuntu-latest
env:
IMAGE_NAME: ghcr.io/${{ github.repository }}-daemon
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.17.0'
- name: Set up Docker
uses: docker/setup-buildx-action@v1
- name: Update CNI
run: make update-cni-local
working-directory: daemon
- name: Login to Docker
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.GH_USERNAME }}
password: ${{ secrets.GH_TOKEN }}
- name: Build and push daemon
uses: docker/build-push-action@v2
with:
context: daemon
push: true
tags: |
${{ env.IMAGE_NAME }}:${{ github.sha }}-${{ github.run_number }}
${{ env.IMAGE_NAME }}:v${{ env.IMAGE_VERSION }}
file: ./daemon/dockerfiles/Dockerfile