-
Notifications
You must be signed in to change notification settings - Fork 13
72 lines (64 loc) · 2.16 KB
/
image-push.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Push container image
on:
push:
branches:
- main
tags:
- 'v*.*.*'
env:
image-push-owner: 'k8snetworkplumbingwg'
jobs:
push-amd64:
name: Image push/amd64
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Version Check
run: |
echo "git_commit_hash=$(git describe --no-match --always --abbrev=40 --dirty)" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Container Registry
if: github.repository_owner == 'k8snetworkplumbingwg'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push container image
if: github.repository_owner == 'k8snetworkplumbingwg'
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}:latest-amd64
file: images/Dockerfile
build-args: |
git_sha=${{ env.git_commit_hash }}
- name: Push stable container image
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}:${{ github.ref_name }}
file: images/Dockerfile
build-args: |
git_sha=${{ env.git_commit_hash }}
- name: Install the j2 dependency
if: startsWith(github.ref, 'refs/tags/')
run: |
pip3 install --user --upgrade jinjanator
j2 --version
- name: Template release manifests
if: startsWith(github.ref, 'refs/tags/')
run: IMAGE_TAG=${{ github.ref_name }} make manifests
- name: Release the kraken
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
generate_release_notes: true
files: |
manifests/crio-dynamic-networks-controller.yaml
manifests/dynamic-networks-controller.yaml