Skip to content

Build

Build #21

Workflow file for this run

name: Build
on:
push:
branches:
- master
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
env:
IMAGE_NAME: bsord/helm-push
PLATFORMS: linux/amd64
jobs:
push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Determine tag or commit
uses: haya14busa/action-cond@v1
id: refortag
with:
cond: ${{ startsWith(github.ref, 'refs/tags/') }}
if_true: ${{ github.ref }}
if_false: latest
- name: Determine image tag
id: imagetag
run: echo "::set-output name=value::${TAG_OR_BRANCH##*/}"
env:
TAG_OR_BRANCH: ${{ steps.refortag.outputs.value }}
- name: Build and push image
uses: docker/build-push-action@v2
with:
tags: ${{ env.IMAGE_NAME }}:${{ steps.imagetag.outputs.value }}
file: Dockerfile
platforms: ${{ env.PLATFORMS }}
push: true