Skip to content

Workflow file for this run

name: Build and Push Container Image
on:
push:
tags:
- 'releases/*.*.*'
branches:
- 'releases/*.*.*'
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: ${{ github.ref_name }}
- name: Determine version
id: version
run: |
REF="${GITHUB_REF_NAME#releases/}"
echo "VERSION=${REF}" >> $GITHUB_ENV
- name: Build container image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: "ghcr.io/${{ github.repository_owner }}/toolbox"
tags: ${{ env.VERSION }} latest
containerfiles: |
./Containerfile
layers: false
- name: Push image to GitHub Container Registry
uses: redhat-actions/push-to-registry@v2
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: "ghcr.io"
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}