GitHub actionsでブランチやタグで変数切り替え
例
code:sample.yml
steps:
- name: Set Stage
run: |
echo '::set-output name=STAGE::develop'
echo '::set-output name=STAGE::staging'
elif ${GITHUB_REF} =~ ^refs/tags/v0-9+\.0-9+\.0-9+$ ; then echo '::set-output name=STAGE::production'
else
exit 1
fi
id: set-stage
- name: Deploy to (${{ steps.set-stage.outputs.STAGE }})
run: make deploy-${{ steps.set-stage.outputs.STAGE }}