Skip to content

Build and Push All The Docker Images #61

Build and Push All The Docker Images

Build and Push All The Docker Images #61

Workflow file for this run

name: Build and Push All The Docker Images
on:
workflow_dispatch: # Manually trigger the workflow
inputs:
tags:
description: "Tag (used as VITE_FMP_VERSION)"
required: true
push:
tags:
- "v*.*.*"
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
folder: [alloy-api, backend, frontend, limboole-api, nuxmv-api, spectra-api, z3-api]
include:
- folder: alloy-api
image_name: ghcr.io/${{ github.repository }}-alloy-api
- folder: backend
image_name: ghcr.io/${{ github.repository }}-backend
- folder: frontend
image_name: ghcr.io/${{ github.repository }}-frontend
- folder: limboole-api
image_name: ghcr.io/${{ github.repository }}-limboole-api
- folder: nuxmv-api
image_name: ghcr.io/${{ github.repository }}-nuxmv-api
- folder: spectra-api
image_name: ghcr.io/${{ github.repository }}-spectra-api
- folder: z3-api
image_name: ghcr.io/${{ github.repository }}-z3-api
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ matrix.image_name }}
tags: |
type=edge,branch=main
type=semver,pattern={{version}}
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to ghcr
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Determine Tags
id: determine-tags
run: |
if [ -n "${{ github.event.inputs.tags }}" ]; then
echo "TAGS=${{ matrix.image_name }}:${{ github.event.inputs.tags }}" >> $GITHUB_ENV
else
echo "TAGS=$(echo "${{ steps.meta.outputs.tags }}" | tr '\n' ',')" >> $GITHUB_ENV
fi
- name: Debug Tags
run: |
echo "Resolved tags: ${{ env.TAGS }}"
- name: Build and Push Docker image
uses: docker/build-push-action@v6
with:
context: ./${{ matrix.folder }}
file: ./${{ matrix.folder }}/Dockerfile
tags: ${{ env.TAGS }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
push: true
build-args: |
VITE_FMP_API_URL=https://play.formal-methods.net/api
VITE_FMP_VERSION=${{ env.TAGS }}