Skip to content

Merge pull request #36 from larsl-net/main #10

Merge pull request #36 from larsl-net/main

Merge pull request #36 from larsl-net/main #10

name: Docker Image Publish
on:
push:
branches: [ "main" ]
tags: [ 'v*.*.*' ]
env:
REGISTRY: ghcr.io
REPOSITORY: ${{ github.repository }}
jobs:
docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# id-token: write
steps:
-
name: Checkout repository
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Docker meta Backend
id: meta-svc
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/dascr-board-svc
-
name: Build and push Backend
id: buid-and-push-svc
uses: docker/build-push-action@v4
with:
context: "{{defaultContext}}"
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
tags: ${{ steps.meta-svc.outputs.tags }}
labels: ${{ steps.meta-svc.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
-
name: Docker meta Frontend
id: meta-ui
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/dascr-board-ui
-
name: Build and push Frontend
id: build-and-push-ui
uses: docker/build-push-action@v4
with:
context: "{{defaultContext}}:frontend"
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64,linux/arm/v7
tags: ${{ steps.meta-ui.outputs.tags }}
labels: ${{ steps.meta-ui.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max