Added workflow to automatically build and push docker images

This commit is contained in:
2025-08-24 17:00:20 +02:00
parent 6d3a139f34
commit 305005de0a

48
.github/workflows/docker-image.yaml vendored Normal file
View File

@@ -0,0 +1,48 @@
name: Docker Image CI
on:
push:
branches: ["main"]
jobs:
build-and-push:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
dertyp7/tealfire-website
tags: |
type=raw,value=latest
type=sha
flavor: |
latest=false
prefix=
suffix=
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}