From dd089a2e38cd3f381a500adfca1ea4e8dd036f25 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 | 18 ++++++++++++++---- fly.staging.toml | 22 ++++++++++++++++++++++ 2 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 fly.staging.toml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f760763..896b01b 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,23 @@ 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 - with: - args: "deploy" + - name: 🎈 Setup Fly + uses: superfly/flyctl-actions/setup-flyctl@1.5 + + - name: 🚀 Deploy Staging + if: ${{ github.ref_name == 'dev'}} + run: flyctl deploy --remote-only --config fly.staging.toml + 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 }} diff --git a/fly.staging.toml b/fly.staging.toml new file mode 100644 index 0000000..51c35b6 --- /dev/null +++ b/fly.staging.toml @@ -0,0 +1,22 @@ +# fly.toml app configuration file generated for nichtsam-com-staging on 2024-03-24T12:28:05Z +# +# See https://fly.io/docs/reference/configuration/ for information about how to use this file. +# + +app = "nichtsam-com-staging" +primary_region = "cdg" + +[build] + +[http_service] +internal_port = 3000 +force_https = true +auto_stop_machines = true +auto_start_machines = true +min_machines_running = 0 +processes = ["app"] + +[[vm]] +cpu_kind = "shared" +cpus = 1 +memory_mb = 256