Skip to content

2.36.0-beta.0

2.36.0-beta.0 #144

name: Build Docker image and push to Docker Hub
on:
release:
types: [ published ]
jobs:
build_and_push:
name: Build a new Docker image for the release (and a latest) and push it to Docker Hub
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout
- uses: actions/checkout@v4
# https://github.com/docker/login-action
- name: Log into Docker Hub
if: github.event_name == 'release'
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
# https://github.com/docker/metadata-action
- name: Extract Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: signalen/backend
flavor: |
latest=${{ github.event_name == 'release' }} # generate 'latest' tag for releases
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v5
with:
context: .
target: prod
push: ${{ github.event_name == 'release' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}