Skip to content

Update build image to v0.0.36 as latest #29

Update build image to v0.0.36 as latest

Update build image to v0.0.36 as latest #29

name: Update build image
run-name: Update build image to ${{ inputs.tag }} as ${{ inputs.latest_tag }}
permissions:
contents: read
on:
workflow_dispatch:
inputs:
tag:
description: 'Image tag in the format vx.x.x'
required: true
type: string
latest_tag:
description: 'Tag image as latest or dev_latest'
required: true
default: dev_latest
type: choice
options:
- latest
- dev_latest
env:
REGISTRY: ghcr.io
IMAGE_NAME: kanisterio/build
jobs:
# TODO: Enable following when we want to automate this workflow on push to master branch
# check-files:
# runs-on: ubuntu-latest
# outputs:
# changed: ${{ steps.changed-files.outputs.any_changed }}
# steps:
# - uses: actions/checkout@v3
# with:
# fetch-depth: 0
# - uses: tj-actions/changed-files@v35
# name: Get changed files
# id: changed-files
# with:
# files: docker/build/Dockerfile
build:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
# TODO: Uncomment following when we enable check-file job
# needs: check-files
# if: needs.check-files.outputs.changed == 'true'
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
- name: Image metadata
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=sha
{{date 'YYYY.MM.DD-HHmm'}}
${{ inputs.tag }}
${{ inputs.latest_tag }}
- name: Login to GHCR
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
with:
context: "{{defaultContext}}:docker/build"
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}