Skip to content

Build and Push Container Image #6

Build and Push Container Image

Build and Push Container Image #6

Workflow file for this run

name: Build and Push Container Image
on:
push:
tags: ['v*']
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get the latest tag
id: get_tag
run: echo ::set-output name=TAG::$(git describe --tags `git rev-list --tags --max-count=1`)
- name: Authenticate to ghcr
run: echo ${{ secrets.GHCR_PAT }} | buildah login --username cjtitus --password-stdin ghcr.io
- name: Run build script
run: bash buildah_scripts/build.sh
- name: Push image
run: |
IMAGE_ID=docker://ghcr.io/${{ github.repository }}/simline
# Make sure IMAGE_ID is lowercase for buildah
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
buildah push simline:latest $IMAGE_ID:latest
buildah push simline:latest $IMAGE_ID:${{ steps.get_tag.outputs.TAG }}