From 8fc2f983d8cda17bea8142512cd1327253353ef3 Mon Sep 17 00:00:00 2001 From: Pat Needham Date: Wed, 22 May 2024 15:11:47 -0400 Subject: [PATCH] deploy action restored --- .github/workflows/deploy.yml | 88 ++++++++++++++++++------------------ fly.toml | 1 + 2 files changed, 44 insertions(+), 45 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 986ed777..1d2c56f0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -136,48 +136,46 @@ jobs: path: playwright-report/ retention-days: 30 - # uncomment when I feel that fly deploy is stable enough - # deploy: - # name: 🚀 Deploy - # runs-on: ubuntu-22.04 - # 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' }} - - # 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 }} - # --build-secret SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }} - # env: - # FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} + uncomment when I feel that fly deploy is stable enough + deploy: + name: 🚀 Deploy + runs-on: ubuntu-22.04 + needs: [lint, typecheck, vitest, playwright] + # only build/deploy main branch on pushes + if: ${{ github.event_name == 'push' }} + + steps: + - name: ⬇️ Checkout repo + uses: actions/checkout@v4 + + - name: 👀 Read app name + uses: SebRollen/toml-action@v1.2.0 + 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@1.5 + + - 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 }} + --build-secret SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }} + env: + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} diff --git a/fly.toml b/fly.toml index bc8a2247..f0576b8d 100644 --- a/fly.toml +++ b/fly.toml @@ -3,6 +3,7 @@ primary_region = "bos" kill_signal = "SIGINT" kill_timeout = 5 processes = [ ] +swap_size_mb = 512 [experimental] allowed_public_ports = [ ]