Skip to content

Commit

Permalink
Change when workflows run (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
DistroByte authored Jan 29, 2024
1 parent 3ea3828 commit 19b4489
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Deploy

on:
push:
workflow_dispatch:
pull_request:
types: [closed]

concurrency:
group: '${{ github.ref }}'
Expand All @@ -20,7 +21,7 @@ jobs:
runs-on: [self-hosted, deployment-runner]
container:
image: git.dbyte.xyz/distro/levant
if: github.ref != 'refs/heads/master' && github.event_name == 'workflow_dispatch'
if: github.ref != 'refs/heads/main' && github.event_name == 'push'
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
Expand All @@ -37,21 +38,20 @@ jobs:
runs-on: [self-hosted, deployment-runner]
container:
image: multani/nomad
if: github.event_name == 'workflow_dispatch'
if: github.event_name == 'pull_request'
timeout-minutes: 60
steps:
- run: echo "null"
- run: nomad status -address=http://nomad.service.consul:4646
- run: nomad job stop -address=http://nomad.service.consul:4646 -purge blockbot-${GITHUB_SHA}
- run: nomad job stop -address=http://nomad.service.consul:4646 -purge blockbot-${GITHUB_REF_NAME}

deploy_prod:
needs:
- deploy_review
- stop_review
- build
runs-on: [self-hosted, deployment-runner]
container:
image: git.dbyte.xyz/distro/levant
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/main'
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
Expand Down

0 comments on commit 19b4489

Please sign in to comment.