Skip to content

Commit

Permalink
Improve deployment pipeline
Browse files Browse the repository at this point in the history
To limit the chances of interleaving workflow runs deploying an
unintended version of PDC, condition the build/push step on successful
completion of lint, test, and sdk tasks.

Use names for steps for friendlier presentation in GH UIs.

Use fuzzy versioning for actions to match our current practice.

Issue #1410
  • Loading branch information
bickelj committed Jan 13, 2025
1 parent dae910f commit 3d755cd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,22 @@ jobs:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Wait for lint, test, 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"
},
]
- name: Build and push
uses: docker/build-push-action@v6
with:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ jobs:
TOKEN: ${{ secrets.DIGITAL_OCEAN_TOKEN }}
URL: ${{ vars.DEPLOYMENT_URL }}
steps:
- uses: kachick/[email protected]
- name: Wait for lint, test, build, and other workflows to succeed
uses: kachick/wait-other-jobs@v3
timeout-minutes: 24
with:
wait-list: |
Expand All @@ -32,6 +33,7 @@ jobs:
"workflowFile": "build.yml"
}
]
- run: |
- 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

0 comments on commit 3d755cd

Please sign in to comment.