Skip to content

fix: hotfix erstiwoche 2024 (#738) #148

fix: hotfix erstiwoche 2024 (#738)

fix: hotfix erstiwoche 2024 (#738) #148

name: Docker Release
on:
release:
types:
- published
push:
branches:
- dev
env:
IMAGE_REGISTRY: ghcr.io
IMAGE_PATH: ${{ github.repository }}
IMAGE_TAG: ${{ github.ref_name }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get latest release
id: latest_release
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: ${{ github.repository }}
excludes: prerelease, draft
- name: Docker Login
uses: docker/login-action@v3
with:
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push (latest release)
uses: docker/build-push-action@v6
if: ${{ github.event_name == 'release' && steps.latest_release.outputs.release == github.ref_name }} # run only on latest release
with:
push: true
tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_PATH }}:${{ env.IMAGE_TAG }}, ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_PATH }}:latest
- name: Build and push (release)
uses: docker/build-push-action@v6
if: ${{ github.event_name == 'release' && steps.latest_release.outputs.release != github.ref_name }} # run only on release (not latest)
with:
push: true
tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_PATH }}:${{ env.IMAGE_TAG }}
- name: Build and push (push)
uses: docker/build-push-action@v6
if: ${{ github.event_name == 'push' }} # run only on push (to dev)
with:
push: true
tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_PATH }}:${{ env.IMAGE_TAG }}