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.sh
script that will run in the pipelineif [ ${DEPLOY:-"false"} == "true" ]thenecho "deploying!"fi- Will only deploy if
DEPLOY
is set to"true"
- Will only deploy if
Add the
workflow_dispatch
event to the pipeline.github/workflows/pipeline.yml
name: 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_dispatch
event through the UI