-
Notifications
You must be signed in to change notification settings - Fork 2
95 lines (83 loc) · 2.97 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
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: Extract VITE_FMP_VERSION
id: extract_version
run: |
if [ -n "${{ github.event.inputs.tags }}" ]; then
echo "VITE_FMP_VERSION=${{ github.event.inputs.tags }}" >> $GITHUB_ENV
else
echo "VITE_FMP_VERSION=$(echo $DOCKER_METADATA_OUTPUT_VERSION)" >> $GITHUB_ENV
fi
- 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.VITE_FMP_VERSION }}