Skip to content

Build and Publish Docker Image for Production #3

Build and Publish Docker Image for Production

Build and Publish Docker Image for Production #3

name: Build and Publish Docker Image for Production
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract version number
id: extract_version
run: echo "VERSION=${{ github.event.release.tag_name }} | sed 's/^v//'" >> $GITHUB_ENV
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.prod
push: true
tags: luftdaten/datahub:${{ env.VERSION }}