Skip to content

Commit

Permalink
fix(cicd): upgrade deploy dispatch gh action usability
Browse files Browse the repository at this point in the history
  • Loading branch information
uladkasach committed Apr 23, 2024
1 parent 483e0a9 commit 6ca3ed8
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,21 @@ on:
workflow_dispatch:
inputs:
stage:
description: 'the stage to which to deploy (dev or prod)'
description: 'which stage do you want to deploy to?'
type: choice
options:
- dev
- prod
required: true
default: 'dev'
thoroughly:
description: 'whether to execute the test suite before deloyment (true or false)'
description: 'should we run tests before this deployment?'
type: choice
required: true
default: 'true'
options:
- 'true'
- 'false'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }} # per [workflow] x [branch, tag]
Expand All @@ -35,7 +45,7 @@ jobs:
uses: ./.github/workflows/.deploy-sls.yml
needs: [test]
if: |
(github.ref == 'refs/heads/main' || github.event.inputs.stage == 'dev') &&
((github.ref == 'refs/heads/main' && github.event_name != 'workflow_dispatch') || github.event.inputs.stage == 'dev') &&
always() && (needs.test.result == 'success' || needs.test.result == 'skipped')
with:
stage: dev
Expand Down

0 comments on commit 6ca3ed8

Please sign in to comment.