Skip to content

Build and Push All The Docker Images #59

Build and Push All The Docker Images

Build and Push All The Docker Images #59

Workflow file for this run

name: CI for GHCR
on:
workflow_dispatch: # Manually trigger the workflow
inputs:
tags:
description: "VITE_FMP_VERSION (Tag)"
required: true
push:
tags:
- "v*.*.*"
jobs:
build_and_publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get the latest tag
id: get_latest_tag
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
LATEST_TAG="${{ github.event.inputs.tags }}"
echo "::set-output name=tag::$LATEST_TAG"
else
TAG_NAME=${GITHUB_REF#refs/tags/}
echo "::set-output name=tag::$TAG_NAME"
fi
- name: Build and push Backend
run: |
cd backend
docker build -t ghcr.io/${{ github.repository }}-backend:latest .
echo ${{ secrets.GHCR_TOKEN }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
docker push ghcr.io/${{ github.repository }}-backend:latest
- name: Build and push Frontend
run: |
cd frontend
TAG_NAME=${{ steps.get_latest_tag.outputs.tag }}
docker build --build-arg VITE_FMP_API_URL=https://play.formal-methods.net/api --build-arg VITE_FMP_VERSION=$TAG_NAME -t ghcr.io/${{ github.repository }}-frontend:latest .
echo ${{ secrets.GHCR_TOKEN }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
docker push ghcr.io/${{ github.repository }}-frontend:latest
- name: Build and push Alloy API
run: |
cd alloy-api
docker build -t ghcr.io/${{ github.repository }}-alloy-api:latest .
echo ${{ secrets.GHCR_TOKEN }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
docker push ghcr.io/${{ github.repository }}-alloy-api:latest