From 85a9346e4c8512bd2412aac0c28c0e751eced409 Mon Sep 17 00:00:00 2001 From: Johnny Graettinger Date: Mon, 4 Nov 2024 15:05:12 -0600 Subject: [PATCH] .github: workflow for data-plane-controller (WIP) --- .github/workflows/data-plane-controller.yaml | 71 ++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/data-plane-controller.yaml diff --git a/.github/workflows/data-plane-controller.yaml b/.github/workflows/data-plane-controller.yaml new file mode 100644 index 0000000000..461d121fc9 --- /dev/null +++ b/.github/workflows/data-plane-controller.yaml @@ -0,0 +1,71 @@ +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 + 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: cd-github-actions@helpful-kingdom-273219.iam.gserviceaccount.com + 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."