-
Notifications
You must be signed in to change notification settings - Fork 61
47 lines (42 loc) · 1.71 KB
/
dockerimage.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
name: Build and Publish Helm container
on:
push:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build and test Helm container
run: |
GIT_BRANCH=${GITHUB_REF#refs/heads/} make docker_build
GIT_BRANCH=${GITHUB_REF#refs/heads/} make test
- name: Docker meta
if: ${{ startsWith(github.ref, 'refs/heads/m') || startsWith(github.ref, 'refs/heads/v') }}
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: lachlanevenson/k8s-helm
tag-semver: |
{{raw}}
- name: Set up QEMU
if: ${{ startsWith(github.ref, 'refs/heads/m') || startsWith(github.ref, 'refs/heads/v') }}
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
if: ${{ startsWith(github.ref, 'refs/heads/m') || startsWith(github.ref, 'refs/heads/v') }}
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
if: ${{ startsWith(github.ref, 'refs/heads/m') || startsWith(github.ref, 'refs/heads/v') }}
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and publish multi-arch Helm container
if: ${{ startsWith(github.ref, 'refs/heads/m') || startsWith(github.ref, 'refs/heads/v') }}
uses: docker/build-push-action@v2
with:
platforms: linux/amd64,linux/s390x,linux/arm64,linux/ppc64le
push: true
tags: |
${{ github.ref != 'refs/heads/master' && steps.docker_meta.outputs.tags || '' }}
${{ github.ref == 'refs/heads/master' && 'lachlanevenson/k8s-helm:latest' || '' }}
labels: ${{ steps.docker_meta.outputs.labels }}