Skip to content

Commit

Permalink
ci: add workflow dispatch logic and fix buildx version
Browse files Browse the repository at this point in the history
  • Loading branch information
yorugac committed Feb 3, 2023
1 parent cbfc0f7 commit d000520
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,20 @@ jobs:
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:
Expand All @@ -34,18 +46,18 @@ jobs:
file: Dockerfile.controller
build-args: |
GO_BUILDER_IMG=golang:1.17
tags: ghcr.io/grafana/operator:latest,ghcr.io/grafana/operator:controller-${{ github.event.release.tag_name }}
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-${{ github.event.release.tag_name }}
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-${{ github.event.release.tag_name }}
tags: ghcr.io/grafana/operator:latest-starter,ghcr.io/grafana/operator:starter-${{env.IMAGETAG}}

0 comments on commit d000520

Please sign in to comment.