Skip to content

feat: promote staging localization and UI updates (#137) #19

feat: promote staging localization and UI updates (#137)

feat: promote staging localization and UI updates (#137) #19

Workflow file for this run

name: Build and Push Images
on:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: build-and-push-images
cancel-in-progress: false
permissions:
contents: read
packages: write
jobs:
build-images:
name: Build Images
runs-on: blacksmith-4vcpu-ubuntu-2404
strategy:
fail-fast: false
matrix:
include:
- dockerfile: ./docker/app.Dockerfile
repo: tradinggoose
- dockerfile: ./docker/db.Dockerfile
repo: migrations
- dockerfile: ./docker/realtime.Dockerfile
repo: realtime
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
if: github.ref == 'refs/heads/main'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: useblacksmith/setup-docker-builder@v1
- name: Generate tags
id: meta
run: |
set -euo pipefail
repo="${{ matrix.repo }}"
ghcr_image="ghcr.io/tradinggoose/${repo}"
sha_tag="${{ github.sha }}"
tags=("${ghcr_image}:${sha_tag}")
if [ "$GITHUB_REF" = "refs/heads/main" ]; then
dockerhub_image="docker.io/${{ secrets.DOCKERHUB_USERNAME }}/${repo}"
tags+=("${ghcr_image}:latest")
tags+=("${dockerhub_image}:${sha_tag}")
tags+=("${dockerhub_image}:latest")
fi
tags_csv=$(IFS=,; printf '%s' "${tags[*]}")
echo "tags=${tags_csv}" >> "$GITHUB_OUTPUT"
- name: Build and push images
uses: useblacksmith/build-push-action@v2
with:
context: .
file: ${{ matrix.dockerfile }}
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
provenance: true
sbom: true