-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.github: workflow for data-plane-controller (WIP)
- Loading branch information
1 parent
dfe28b9
commit ebb246f
Showing
1 changed file
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
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 | ||
RUSTFLAGS: "-C link-arg=-fuse-ld=lld" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
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 | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
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." |