Skip to content

Merge pull request #122 from david-loe/david-loe/issue43 #137

Merge pull request #122 from david-loe/david-loe/issue43

Merge pull request #122 from david-loe/david-loe/issue43 #137

name: Publish Images
on:
workflow_dispatch:
push:
tags: ['**']
branches: ['main']
permissions:
packages: write
jobs:
build-test-migrate:
uses: ./.github/workflows/migration-test.yml
build_and_publish_platform_containers:
name: Build and publish platform containers
needs: [build-test-migrate]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta for backend
id: meta-backend
uses: docker/metadata-action@v5
with:
images: |
davidloe/abrechnung-backend
ghcr.io/david-loe/abrechnung-backend
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Docker meta for frontend
id: meta-frontend
uses: docker/metadata-action@v5
with:
images: |
davidloe/abrechnung-frontend
ghcr.io/david-loe/abrechnung-frontend
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Build and push backend image
uses: docker/build-push-action@v5
with:
context: .
file: ./backend/Dockerfile.production
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-backend.outputs.tags }}
- name: Build and push frontend image
uses: docker/build-push-action@v5
with:
context: .
file: ./frontend/Dockerfile.production
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-frontend.outputs.tags }}