Merge pull request #1791 from PhilanthropyDataCommons/dependabot/npm_… #293
This file contains hidden or 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: | |
push: | |
branches: | |
- 'main' | |
jobs: | |
deploy-to-test-env: | |
runs-on: ubuntu-latest | |
environment: Test | |
name: Deploy to Test environment | |
env: | |
TOKEN: ${{ secrets.DIGITAL_OCEAN_TOKEN }} | |
URL: ${{ vars.DEPLOYMENT_URL }} | |
steps: | |
- name: Wait for lint, test, build, and other workflows to succeed | |
uses: kachick/wait-other-jobs@v3 | |
timeout-minutes: 24 | |
with: | |
wait-list: | | |
[ | |
{ | |
"workflowFile": "lint.yml" | |
}, | |
{ | |
"workflowFile": "test.yml" | |
}, | |
{ | |
"workflowFile": "sdk.yml" | |
}, | |
{ | |
"workflowFile": "build.yml" | |
} | |
] | |
- name: Deploy to Digital Ocean Test environment | |
run: | | |
set -eo pipefail | |
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer ${{ env.TOKEN }}" --url "${{ env.URL }}" -d '{ "force_build": true }' | jq -e .deployment.id | |
deploy-to-production-env: | |
runs-on: ubuntu-latest | |
environment: Production | |
name: Deploy to Production environment | |
env: | |
TOKEN: ${{ secrets.DIGITAL_OCEAN_TOKEN }} | |
URL: ${{ vars.DEPLOYMENT_URL }} | |
needs: deploy-to-test-env | |
steps: | |
- name: Deploy to Digital Ocean Production environment | |
run: | | |
set -eo pipefail | |
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer ${{ env.TOKEN }}" --url "${{ env.URL }}" -d '{ "force_build": true }' | jq -e .deployment.id |