This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
Build & Push #4
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 & Push | |
on: | |
push: | |
branches: | |
- 'main' | |
jobs: | |
build-push: | |
runs-on: ubuntu-latest | |
env: | |
REGISTRY: ghcr.io/${{ github.repository_owner }} | |
IMAGE_NAME: nomad-logger | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Build | |
id: build-image | |
uses: redhat-actions/buildah-build@v2 | |
with: | |
image: ${{ env.IMAGE_NAME }} | |
tags: latest ${{ github.sha }} | |
containerfiles: | | |
./Containerfile | |
- name: Login to GitHub Container Registry | |
uses: redhat-actions/podman-login@v1 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Container image to GitHub Container Registry | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
image: ${{ steps.build-image.outputs.image }} | |
tags: ${{ steps.build-image.outputs.tags }} | |
registry: ${{ env.REGISTRY }} |