Skip to content

.github: workflow for data-plane-controller (WIP) #3

.github: workflow for data-plane-controller (WIP)

.github: workflow for data-plane-controller (WIP) #3

name: Deploy data-plane-controller
on:
workflow_dispatch:
inputs:
environment:
description: "Environment to deploy to (e.g., staging or production)"
required: true
default: "staging"
push:
branches: [johnny/dpc-cd]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
lfs: true
- uses: supabase/setup-cli@v1
with:
version: latest
- run: supabase start
- uses: Swatinem/rust-cache@v2
- name: Build `data-plane-controller`
run: cargo build --release -p data-plane-controller
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: rust-binaries
path: |
./target/release/data-plane-controller
deploy-artifacts:
runs-on: ubuntu-24.04
needs: build
# Permissions required of the Github token in order for
# federated identity and authorization to work.
permissions:
contents: read
id-token: write
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
lfs: true
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: rust-binaries
- name: Authenticate with GCP Workload Identity Federation
uses: google-github-actions/auth@v2
with:
service_account: [email protected]
workload_identity_provider: projects/671073686895/locations/global/workloadIdentityPools/github/providers/github
- name: Deploy to environment
run: |
echo "Deploying artifacts to environment: ${{ github.event.inputs.environment }}"
echo "Deployment process is ongoing..."
echo "Deployment completed successfully."