Skip to content

Merge pull request #1459 from PhilanthropyDataCommons/1407-update-que… #61

Merge pull request #1459 from PhilanthropyDataCommons/1407-update-que…

Merge pull request #1459 from PhilanthropyDataCommons/1407-update-que… #61

Workflow file for this run

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