diff --git a/.github/workflows/heat-stack.yml b/.github/workflows/heat-stack.yml index 140bfd2e..3acde03d 100644 --- a/.github/workflows/heat-stack.yml +++ b/.github/workflows/heat-stack.yml @@ -3,6 +3,7 @@ on: push: branches: - main + - test-rules-whl-deployment # - dev pull_request: {} @@ -155,46 +156,46 @@ jobs: # path: playwright-report/ # retention-days: 30 - # deploy: - # name: 🚀 Deploy - # runs-on: ubuntu-latest - # needs: [lint, typecheck, vitest, playwright] - # # only build/deploy main branch on pushes - # if: - # ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && - # github.event_name == 'push' }} + deploy: + name: 🚀 Deploy + runs-on: ubuntu-latest + needs: [lint, typecheck, vitest] #, playwright] + # only build/deploy main branch on pushes + if: + ${{ (github.ref == 'test-rules-whl-deployment' || github.ref == 'refs/heads/dev') && + github.event_name == 'push' }} - # steps: - # - name: ⬇️ Checkout repo - # uses: actions/checkout@v3 + steps: + - name: ⬇️ Checkout repo + uses: actions/checkout@v3 - # - name: 👀 Read app name - # uses: SebRollen/toml-action@v1.0.2 - # id: app_name - # with: - # file: 'fly.toml' - # field: 'app' - - # # move Dockerfile to root - # - name: 🚚 Move Dockerfile - # run: | - # mv ./other/Dockerfile ./Dockerfile - # mv ./other/.dockerignore ./.dockerignore - - # - name: 🎈 Setup Fly - # uses: superfly/flyctl-actions/setup-flyctl@v1.4 - - # - name: 🚀 Deploy Staging - # if: ${{ github.ref == 'refs/heads/dev' }} - # run: - # flyctl deploy --remote-only --build-arg COMMIT_SHA=${{ github.sha }} - # --app ${{ steps.app_name.outputs.value }}-staging - # env: - # FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} - - # - name: 🚀 Deploy Production - # if: ${{ github.ref == 'refs/heads/main' }} - # run: - # flyctl deploy --remote-only --build-arg COMMIT_SHA=${{ github.sha }} - # env: - # FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} + - name: 👀 Read app name + uses: SebRollen/toml-action@v1.0.2 + id: app_name + with: + file: '${{ env.working-directory }}/fly.toml' + field: 'app' + + # move Dockerfile to root + - name: 🚚 Move Dockerfile + run: | + mv ${{ env.working-directory }}/other/Dockerfile ./Dockerfile + mv ${{ env.working-directory }}/other/.dockerignore ./.dockerignore + + - name: 🎈 Setup Fly + uses: superfly/flyctl-actions/setup-flyctl@v1.4 + + - name: 🚀 Deploy Staging + if: ${{ github.ref == 'refs/heads/dev' }} + run: + flyctl deploy ${{ env.working-directory }} --remote-only --build-arg COMMIT_SHA=${{ github.sha }} + --app ${{ steps.app_name.outputs.value }}-staging + env: + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} + + - name: 🚀 Deploy Production + if: ${{ github.ref == 'test-rules-whl-deployment' }} + run: + flyctl deploy ${{ env.working-directory }} --remote-only --build-arg COMMIT_SHA=${{ github.sha }} + env: + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} diff --git a/heat-stack/fly.toml b/heat-stack/fly.toml index c4908f18..1a1c9bc8 100644 --- a/heat-stack/fly.toml +++ b/heat-stack/fly.toml @@ -1,5 +1,5 @@ app = "heat-app-7964" -primary_region = "sjc" +primary_region = "box" kill_signal = "SIGINT" kill_timeout = 5 processes = [ ]