Gated steps with GitHub Actions
October 20, 2020
The workflow_dispatch event allows us to manually trigger a build with given parameters.
Add the
deploy.shscript that will run in the pipelineif [ ${DEPLOY:-"false"} == "true" ]thenecho "deploying!"fi- Will only deploy if
DEPLOYis set to"true"
- Will only deploy if
Add the
workflow_dispatchevent to the pipeline.github/workflows/pipeline.ymlname: pipelineon:push:branches:- masterworkflow_dispatch:inputs:deploy:description: deployrequired: truedefault: "true"jobs:pipeline:runs-on: ubuntu-lateststeps:- uses: actions/checkout@v2- name: deployenv:DEPLOY: ${{ github.event.inputs.deploy }}run: |sh ./deploy.shTrigger the
workflow_dispatchevent through the UI