Build and Push CI Image #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Push CI Image | |
on: | |
workflow_dispatch | |
env: | |
REGISTRY_USER: ${{ github.actor }} | |
REGISTRY_PASSWORD: ${{ github.token }} | |
IMAGE_REGISTRY: ghcr.io/hulks | |
jobs: | |
build: | |
name: Build and Push CI Image | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build Image | |
id: build-image | |
uses: redhat-actions/buildah-build@v2 | |
with: | |
image: github-notifications | |
tags: latest ${{ github.sha }} | |
containerfiles: | | |
Containerfile | |
- name: Log in to ghcr.io | |
uses: redhat-actions/podman-login@v1 | |
with: | |
username: ${{ env.REGISTRY_USER }} | |
password: ${{ env.REGISTRY_PASSWORD }} | |
registry: ${{ env.IMAGE_REGISTRY }} | |
- name: Push To ghcr.io | |
id: push-to-ghcr | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
image: ${{ steps.build-image.outputs.image }} | |
tags: ${{ steps.build-image.outputs.tags }} | |
registry: ${{ env.IMAGE_REGISTRY }} | |
- name: Print image url | |
run: echo "Image pushed to ${{ steps.push-to-ghcr.outputs.registry-paths }}" |