forked from grafana/grafana-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (48 loc) · 1.6 KB
/
release.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
name: Release container
on:
push:
tags:
- "*"
jobs:
container-images:
name: Build and push container images
runs-on: ubuntu-latest
env:
DOCKER_REGISTRY: quay.io
DOCKER_REPOSITORY: grafana-operator/grafana-operator
DOCKER_PLATFORMS: linux/amd64,linux/arm64,linux/s390x,linux/ppc64le
steps:
- name: Clone repo and checkout submodules
uses: actions/[email protected]
with:
submodules: recursive
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: "1.18"
- name: Prepare
id: prep
run: |
VERSION=sha-${GITHUB_SHA::8}
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF/refs\/tags\//}
fi
echo ::set-output name=BUILD_DATE::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
echo ::set-output name=VERSION::${VERSION}
echo ::set-output name=BUILDARCH::$(go env GOARCH)
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Log in to quay.io
uses: docker/login-action@v1
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Build and push multi-arch Docker image
uses: docker/build-push-action@v2
with:
platforms: ${{ env.DOCKER_PLATFORMS }}
push: true
tags: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_REPOSITORY }}:${{ steps.prep.outputs.VERSION }}