From a197523171f2d5c8d41a578caf2f11e47ac4f933 Mon Sep 17 00:00:00 2001 From: Samuel Jensen <44519206+nichtsam@users.noreply.github.com> Date: Sun, 24 Mar 2024 12:18:36 +0000 Subject: [PATCH] dev environment isolation --- .github/workflows/deploy.yml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f760763..1d95cfb 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,6 +3,7 @@ on: push: branches: - main + - dev concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -105,14 +106,30 @@ jobs: name: 🚀 Deploy runs-on: ubuntu-latest needs: [lint, typecheck, vitest, migration] + if: ${{ github.ref_name == 'main' || github.ref_name == 'dev'}} steps: - name: 👀 Checkout repo uses: actions/checkout@v4 - - name: 🚀 Deploy - uses: superfly/flyctl-actions@1.5 + - name: 🧐 Read app name + uses: SebRollen/toml-action@v1.2.0 + id: app_name with: - args: "deploy" + file: "fly.toml" + field: "app" + + - name: 🎈 Setup Fly + uses: superfly/flyctl-actions/setup-flyctl@1.5 + + - name: 🚀 Deploy Staging + if: ${{ github.ref_name = 'main'}} + run: flyctl deploy --remote-only --app ${{ steps.app_name.outputs.value }}-staging + env: + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} + + - name: 🚀 Deploy Production + if: ${{ github.ref_name = 'main'}} + run: flyctl deploy --remote-only env: FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}