Skip to content

Commit

Permalink
Add workflow for Docker image building
Browse files Browse the repository at this point in the history
  • Loading branch information
h3ndrk committed Dec 1, 2023
1 parent 19c056e commit ef2688d
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build and Push Image
on: push

env:
IMAGE_NAME: mopad
IMAGE_TAGS: latest ${{ github.sha }} ${{ github.ref_name }}
IMAGE_REGISTRY: docker://ghcr.io/hulks/
REGISTRY_USER: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ github.token }}

jobs:
build:
name: Build and push image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: ${{ env.IMAGE_TAGS }}
containerfiles: |
./Dockerfile
- name: Push to ghcr.io
id: push-to-registry
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}

- name: Echo outputs
run: |
echo "${{ toJSON(steps.push-to-registry.outputs) }}"

0 comments on commit ef2688d

Please sign in to comment.