This commit is contained in:
Tomas Dvorak
2026-05-07 10:17:07 +02:00
parent b7d86ad5f8
commit 7051459017
4 changed files with 94 additions and 62 deletions
+4 -49
View File
@@ -16,7 +16,7 @@ permissions:
packages: write
jobs:
build-backend:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@@ -44,62 +44,17 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/backend
images: ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=sha
- name: Build and push backend image
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
file: backend/Dockerfile
push: ${{ github.event_name == 'push' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to registry (push only) - GitHub
if: github.event_name == 'push' && github.server_url == 'https://github.com'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to registry (push only) - Gitea
if: github.event_name == 'push' && github.server_url != 'https://github.com'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.GITEA_USERNAME || github.actor }}
password: ${{ secrets.GITEA_TOKEN || secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/frontend
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=sha
- name: Build and push frontend image
uses: docker/build-push-action@v6
with:
context: ./frontend
file: frontend/Dockerfile
file: Dockerfile
push: ${{ github.event_name == 'push' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}