-
Notifications
You must be signed in to change notification settings - Fork 147
63 lines (61 loc) · 1.88 KB
/
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
---
name: "push"
on:
workflow_dispatch:
inputs:
image_tag:
description: 'Image tag name.'
required: true
release:
types:
- published
jobs:
build:
name: "Build"
runs-on: ubuntu-latest
steps:
- name: "Build:checkout"
uses: actions/checkout@v2
- name: "Set image tag name"
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "IMAGETAG=${{ github.event.inputs.image_tag }}" >> $GITHUB_ENV
else
echo "IMAGETAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
fi
- name: "Check image tag name"
run: |
echo "IMAGETAG=${{env.IMAGETAG}}"
- name: "Build:buildx"
uses: docker/setup-buildx-action@v1
with:
version: v0.9.1 # Buildx version
- name: "Build:login"
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: "Build:dockerimage"
uses: docker/build-push-action@v2
with:
context: .
push: true
file: Dockerfile.controller
build-args: |
GO_BUILDER_IMG=golang:1.18
tags: ghcr.io/grafana/operator:latest,ghcr.io/grafana/operator:controller-${{env.IMAGETAG}}
- name: "Build:dockerimage"
uses: docker/build-push-action@v2
with:
context: .
push: true
file: Dockerfile.runner
tags: ghcr.io/grafana/operator:latest-runner,ghcr.io/grafana/operator:runner-${{env.IMAGETAG}}
- name: "Build:dockerimage"
uses: docker/build-push-action@v2
with:
context: .
push: true
file: Dockerfile.starter
tags: ghcr.io/grafana/operator:latest-starter,ghcr.io/grafana/operator:starter-${{env.IMAGETAG}}