Implements Deploy via Dispatcher

This commit is contained in:
2023-10-24 20:11:38 -03:00
parent 465d248125
commit f5a881e0a9

View File

@@ -43,3 +43,12 @@ jobs:
- name: Terraform Apply - name: Terraform Apply
if: github.event_name == 'push' if: github.event_name == 'push'
run: terraform apply -auto-approve -input=false run: terraform apply -auto-approve -input=false
- name: Deploy Project via Dispatcher
env:
DISPATCHER_EVENT: ${{env.TF_WORKSPACE == 'prod' && 'deploy-prod' || 'deploy-staging'}}
run: |
curl -X POST https://api.github.com/repos/HideyoshiNakazone/infra-hideyoshi.com/dispatches \
-H 'Accept: application/vnd.github.everest-preview+json' \
-u ${{ secrets.ACTIONS_KEY }} \
--data '{"event_type": "${{env.DISPATCHER_EVENT}}" }'