From a8b5b104f52f88187d5b9fc22c208b020094271a Mon Sep 17 00:00:00 2001 From: Marty Nelson Date: Tue, 31 Oct 2023 10:55:37 -0700 Subject: [PATCH] handle prod deployment --- .github/workflows/ci.yml_onhold | 25 ----------------------- .github/workflows/deploy-test.yml | 31 ----------------------------- .github/workflows/spiritwave-ai.yml | 10 +++++----- 3 files changed, 5 insertions(+), 61 deletions(-) delete mode 100644 .github/workflows/ci.yml_onhold delete mode 100644 .github/workflows/deploy-test.yml diff --git a/.github/workflows/ci.yml_onhold b/.github/workflows/ci.yml_onhold deleted file mode 100644 index 92a9994..0000000 --- a/.github/workflows/ci.yml_onhold +++ /dev/null @@ -1,25 +0,0 @@ -name: CI - -on: [push, pull_request] - -jobs: - run-ci: - name: Lint project and deploy functions - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Use Node.js 18.x - uses: actions/setup-node@v3 - with: - node-version: 18.x - - - name: Use Deno v1 latest - uses: denoland/setup-deno@v1 - with: - deno-version: v1.x - - - run: npm ci - - run: npm run lint diff --git a/.github/workflows/deploy-test.yml b/.github/workflows/deploy-test.yml deleted file mode 100644 index b85c598..0000000 --- a/.github/workflows/deploy-test.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Deploy Supabase - -on: - workflow_call: - inputs: - project-id: - required: true - type: string - secrets: - token: - required: true - db-password: - required: true - -jobs: - deploy-staging: - name: Deploy Supabase - runs-on: ubuntu-latest - env: - SUPABASE_ACCESS_TOKEN: ${{ secrets.token }} - SUPABASE_DB_PASSWORD: ${{ secrets.db-password }} - SUPABASE_PROJECT_ID: ${{ inputs.project-id }} - - steps: - - name: Log Info - run: | - echo "env: ${{ github.ref_name }}" - echo "project: $SUPABASE_PROJECT_ID" - echo "token: $SUPABASE_ACCESS_TOKEN" - echo "db-pwd: $SUPABASE_DB_PASSWORD" - \ No newline at end of file diff --git a/.github/workflows/spiritwave-ai.yml b/.github/workflows/spiritwave-ai.yml index e67b0ff..19b19ec 100644 --- a/.github/workflows/spiritwave-ai.yml +++ b/.github/workflows/spiritwave-ai.yml @@ -27,14 +27,14 @@ jobs: name: Lint www - run: npm run lint:ts name: Lint supabase/functions - + deploy: - if: github.ref_name == 'staging' + if: github.ref_name == 'staging' || github.ref_name == 'main' needs: run-ci - name: Deploy to Staging + name: Deployment Check uses: ./.github/workflows/deploy.yml with: - project-id: ${{ vars.STAGING_SUPABASE_PROJECT_ID}} + project-id: ${{ github.ref_name == 'main' && vars.SUPABASE_PROJECT_ID || vars.STAGING_SUPABASE_PROJECT_ID}} secrets: token: ${{ secrets.SUPABASE_ACCESS_TOKEN }} - db-password: ${{ secrets.STAGING_SUPABASE_DB_PASSWORD }} + db-password: ${{ github.ref_name == 'main' && secrets.SUPABASE_DB_PASSWORD || secrets.STAGING_SUPABASE_DB_PASSWORD}}