From 03b74fd90ad78348da2b3834b7a33a2fd09f653e Mon Sep 17 00:00:00 2001 From: Sphericalkat Date: Mon, 29 May 2023 14:53:04 +0530 Subject: [PATCH] refactor(deploy): run deploy workflow only if tests succeeded Signed-off-by: Sphericalkat --- .github/workflows/deploy.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a7b9cd4..8465ced 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,12 +1,17 @@ name: Fly Deploy -on: [push] +on: + workflow_run: + workflows: ["Run tests"] + branches: [main] + types: + - completed env: FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} jobs: deploy: - name: Deploy to fly.io - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: superfly/flyctl-actions/setup-flyctl@master - - run: flyctl deploy --remote-only \ No newline at end of file + name: Deploy to fly.io + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: superfly/flyctl-actions/setup-flyctl@master + - run: flyctl deploy --remote-only