Skip to content

Kickoff deploy

Kickoff deploy #78

Workflow file for this run

name: Kickoff deploy
on:
workflow_run:
workflows: ["Build and test"]
branches: [ main ]
types: [completed]
jobs:
dispatch-deploy:
runs-on: "ubuntu-latest"
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
# - name: Repository Dispatch
# uses: peter-evans/repository-dispatch@v3
# with:
# token: ${{ secrets.DEPLOY_PAT }}
# repository: pretagov/deploy-helm
# event-type: deploy
- name: Workflow Dispatch
run: |
http_response=$(curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.DEPLOY_PAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/pretagov/deploy-helm/actions/workflows/deploy-to-k8s.yaml/dispatches \
-d '{"ref":"main","inputs":{}}' \
-o response.txt -w "%{response_code}")
if [ $http_response != "204" ]; then
exit 1
else
echo "Server returned:"
cat response.txt
fi