Skip to content

Commit

Permalink
Migrating image building to happen on github instad of Rahti.
Browse files Browse the repository at this point in the history
  • Loading branch information
MLumme committed Jul 4, 2024
1 parent 9395c5f commit 529ac79
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish Docker Image

on:
push:
branches: ['main', 'development']

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Buildah Action
id: build_image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: ${{ steps.meta.outputs.tags }}
oci: true
containerfiles: |
./Dockerfile
- name: Push To GHCR
uses: redhat-actions/push-to-registry@v2
with:
tags: ${{ steps.build_image.outputs.tags }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 529ac79

Please sign in to comment.