Skip to content

⛔️ tweak to test the build system on this branch #1

⛔️ tweak to test the build system on this branch

⛔️ tweak to test the build system on this branch #1

Workflow file for this run

on:
push:
branches:
- 'main'
- 'danniel/backendRefactor'
tags:
- 'v*'
name: Build Docker image
jobs:
build-prerequisites:
name: Setup the build process
runs-on: ubuntu-latest
outputs:
buildx-name: ${{ steps.buildx.outputs.name }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
build-backend:
name: Build Backend Docker Image
runs-on: ubuntu-latest
needs: build-prerequisites
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/code4romania/seismic-risc-backend
tags: |
type=edge
type=edge,branch=danniel/backendRefactor
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build and push
uses: docker/build-push-action@v5
with:
builder: ${{ needs.build-prerequisites.outputs.buildx-name }}
context: ./api
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-frontend:
name: Build Frontend Docker Image
runs-on: ubuntu-latest
needs: build-prerequisites
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/code4romania/seismic-risc-frontend
tags: |
type=edge
type=edge,branch=danniel/backendRefactor
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build and push
uses: docker/build-push-action@v5
with:
builder: ${{ needs.build-prerequisites.outputs.buildx-name }}
context: ./client
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max