Skip to content

feat(frontend): funding wizard (quote→confirm→execute) + saga timelin… #24

feat(frontend): funding wizard (quote→confirm→execute) + saga timelin…

feat(frontend): funding wizard (quote→confirm→execute) + saga timelin… #24

name: "Frontend Build & Publish"
on:
push:
branches: [main]
paths:
- "frontend/**"
- ".github/workflows/frontend-deploy.yml"
workflow_dispatch:
inputs:
tag_suffix:
description: "Optional tag suffix (e.g. rc1)"
required: false
type: string
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract image metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/robson-frontend-v2
tags: |
type=sha,prefix=sha-,format=short
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value=${{ github.event.inputs.tag_suffix }},enable=${{ github.event.inputs.tag_suffix != '' }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: frontend
file: frontend/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
PUBLIC_ROBSON_API_BASE=${{ vars.PUBLIC_ROBSON_API_BASE_PROD }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Image digest
run: echo "Image digest ${{ steps.meta.outputs.digest }}"
- name: Compute SHA tag
id: tag
run: echo "sha_tag=sha-$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT
- name: Update frontend image tag in rbx-infra
env:
GITOPS_TOKEN: ${{ secrets.GITOPS_TOKEN }}
SHA_TAG: ${{ steps.tag.outputs.sha_tag }}
REPO: ${{ github.repository }}
SHA: ${{ github.sha }}
run: |
git clone https://x-access-token:${GITOPS_TOKEN}@github.com/rbxrobotica/rbx-infra.git /tmp/rbx-infra
cd /tmp/rbx-infra
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
sed -i "s|image: ghcr.io/ldamasio/robson-frontend-v2:sha-[a-f0-9]*|image: ghcr.io/ldamasio/robson-frontend-v2:${SHA_TAG}|g" \
apps/prod/robson/robson-frontend-v2-deploy.yml
git add apps/prod/robson/robson-frontend-v2-deploy.yml
if git diff --staged --quiet; then
echo "No manifest changes needed (already at ${SHA_TAG})"
exit 0
fi
git commit -m "chore(robson-frontend-v2): update image tag to ${SHA_TAG}" \
-m "Automated update by Robson frontend CI/CD pipeline." \
-m "Triggered by: ${REPO}@${SHA}" \
-m "[skip ci]"
for i in 1 2 3; do
if git push origin main; then
echo "Manifests pushed - ArgoCD will auto-sync"
exit 0
fi
echo "Push attempt $i failed, rebasing..."
git pull --rebase origin main
done
echo "::error::Failed to push to rbx-infra after 3 attempts"
exit 1
- name: Summary
run: |
echo "## Robson frontend published" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| | |" >> $GITHUB_STEP_SUMMARY
echo "|---|---|" >> $GITHUB_STEP_SUMMARY
echo "| Image | \`ghcr.io/${{ github.repository_owner }}/robson-frontend-v2:${{ steps.tag.outputs.sha_tag }}\` |" >> $GITHUB_STEP_SUMMARY
echo "| Commit | \`${{ github.sha }}\` |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "ArgoCD will auto-sync when rbx-infra manifest is updated." >> $GITHUB_STEP_SUMMARY