Skip to content

Instantly share code, notes, and snippets.

@dennybaa
Created March 20, 2024 08:26
Show Gist options
  • Save dennybaa/459b27bea2735962ce0986d9d822b1aa to your computer and use it in GitHub Desktop.
Save dennybaa/459b27bea2735962ce0986d9d822b1aa to your computer and use it in GitHub Desktop.
name: Publish Image
on:
workflow_dispatch:
inputs:
imageName:
type: string
description: Directory and the image name with a Dockerfile
env:
REGISTRY: europe-central2-docker.pkg.dev
IMAGE_REPO: matreshka-370118/app-repository
IMAGE_NAME: ${{ github.event.inputs.imageName }}
jobs:
build:
runs-on: small
container:
image: images/ubuntu:22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_REPO }}/${{ env.IMAGE_NAME }}
context: ./${{ env.IMAGE_NAME }}
tags: latest
containerfiles: |
./${{ env.IMAGE_NAME }}/Dockerfile
- name: Push to Artifact Registry
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ${{ env.REGISTRY }}
username: _json_key_base64
password: ${{ secrets.GCP_MATRESHKA_ROBOT }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment