GHA auto docker image build

This commit is contained in:
Marcin Czop 2025-02-05 17:59:06 +01:00
parent 72f3ee840c
commit 243db11b4b
No known key found for this signature in database
GPG key ID: 44BCC84471234D0D

32
.github/workflows/docker-build.yml vendored Normal file
View file

@ -0,0 +1,32 @@
name: Docker Image CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner}}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: lowercase github.repository
run: echo "IMAGE_NAME=${GITHUB_REPOSITORY@L}" >> ${GITHUB_ENV}
- name: Build and push
uses: docker/build-push-action@v6
with:
file: trackdirect-db.dockerfile
push: true
tags: |
ghcr.io/${{ env.IMAGE_NAME }}:latest
ghcr.io/${{ env.IMAGE_NAME }}:${{ github.RUN_ID }}