Skip to content

chore(debugger): migrate to uv (#847) #218

chore(debugger): migrate to uv (#847)

chore(debugger): migrate to uv (#847) #218

Workflow file for this run

name: Deploy
on:
workflow_dispatch:
push:
branches:
- dev
- staging
env:
ENVIRONMENT: ${{ github.ref_name == 'dev' && 'prod' || 'staging' }}
IMAGE_NAME: ${{ github.ref_name == 'dev' && 'structs' || 'structs-staging' }}
jobs:
build:
name: "Build (${{ matrix.component }})"
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
component: [client, debugger]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: ${{ matrix.component }}
push: true
platforms: linux/amd64
file: ${{ matrix.component }}/Dockerfile.prod
tags: |
ghcr.io/devsoc-unsw/${{ env.IMAGE_NAME }}-${{ matrix.component }}:${{ github.sha }}
ghcr.io/devsoc-unsw/${{ env.IMAGE_NAME }}-${{ matrix.component }}:latest
build-args: "VITE_DEBUGGER_URL=https://structs.sh"
deploy:
name: Deploy (CD)
runs-on: ubuntu-latest
needs: [build]
concurrency: ${{ github.ref_name == 'dev' && 'production' || 'staging' }}
environment: ${{ github.ref_name == 'dev' && 'production' || 'staging' }}
steps:
- name: Dispatch deployment
uses: devsoc-unsw/deployment-dispatch-action@main
with:
deployment-dispatcher-app-id: ${{ vars.DEPLOYMENT_DISPATCHER_APP_ID }}
deployment-dispatcher-app-private-key: ${{ secrets.DEPLOYMENT_DISPATCHER_APP_PRIVATE_KEY }}
updates: |
ghcr.io/devsoc-unsw/${{ env.IMAGE_NAME }}-client=${{ github.sha }}
ghcr.io/devsoc-unsw/${{ env.IMAGE_NAME }}-debugger=${{ github.sha }}