deploy #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: deploy | |
on: | |
workflow_dispatch | |
jobs: | |
deploy: | |
name: deploy | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: ToshihitoKon/slack-quickpost@v1 | |
with: | |
version: 0.7.1 | |
- run: | | |
slack-quickpost \ | |
--channel ${SLACK_CHANNEL} \ | |
--username "GitHub Actions: ${{ github.workflow }}" \ | |
--text ":black_square_for_stop: Waiting manual approve..." | |
- name: Wait manual approve | |
timeout-minutes: 5 | |
run: | | |
isApproved=false | |
until ${isApproved}; do | |
sleep 10 | |
result=$(gh run list \ | |
--workflow approve.yml \ | |
--status success \ | |
--branch ${{ github.ref_name }} \ | |
--json headSha \ | |
--jq '.[].headSha' \ | |
--limit 1) | |
# github.shaが一致すればOK | |
if [ "${{ github.sha }}" = "${result}" ]; then | |
isApproved=true | |
fi | |
done | |
- run: | | |
slack-quickpost \ | |
--channel ${SLACK_CHANNEL} \ | |
--username "GitHub Actions: ${{ github.workflow }}" \ | |
--text ":thumbsup: Deploy Approved!" |