Skip to content

Commit

Permalink
ci: .github/workflows/api.yml has workflow_dispatch manual trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
gobengo committed Nov 13, 2023
1 parent e9b2dcc commit a61f788
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ on:
- 'packages/db/**'
- '.github/workflows/api.yml'
- 'package-lock.json'
workflow_dispatch:
inputs:
force_deploy_staging:
description: whether to deploy to staging even if the job wouldn't normally run
required: true
type: boolean
default: false
force_deploy_production:
description: whether to deploy to production even if the job wouldn't normally run
required: true
type: boolean
default: false

jobs:
test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -52,7 +65,7 @@ jobs:

deploy-staging:
name: Deploy Staging
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || inputs.force_deploy_staging
runs-on: ubuntu-latest
needs: test
environment:
Expand Down Expand Up @@ -88,7 +101,7 @@ jobs:
deploy-production:
name: Deploy Production
if: (github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.changelog.outputs.releases_created) || inputs.force_release
if: (github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.changelog.outputs.releases_created) || inputs.force_deploy_production
runs-on: ubuntu-latest
needs:
- test
Expand Down

0 comments on commit a61f788

Please sign in to comment.