diff --git a/.github/workflows/fly-deploy.yml b/.github/workflows/fly-deploy.yml deleted file mode 100644 index b0c246ed..00000000 --- a/.github/workflows/fly-deploy.yml +++ /dev/null @@ -1,18 +0,0 @@ -# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/ - -name: Fly Deploy -on: - push: - branches: - - main -jobs: - deploy: - name: Deploy app - runs-on: ubuntu-latest - concurrency: deploy-group # optional: ensure only one action runs at a time - steps: - - uses: actions/checkout@v4 - - uses: superfly/flyctl-actions/setup-flyctl@master - - run: flyctl deploy --remote-only - env: - FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test_and_deploy.yml similarity index 81% rename from .github/workflows/test.yml rename to .github/workflows/test_and_deploy.yml index 9bf4e87f..46720818 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test_and_deploy.yml @@ -1,4 +1,4 @@ -name: Test +name: Test & Deploy on: push jobs: @@ -50,3 +50,15 @@ jobs: shell: sh - run: mix deps.get - run: mix test + + deploy: + name: Deploy app + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + concurrency: deploy-group # optional: ensure only one action runs at a time + steps: + - uses: actions/checkout@v4 + - uses: superfly/flyctl-actions/setup-flyctl@master + - run: flyctl deploy --remote-only + env: + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}