Skip to content

Commit

Permalink
Fix API Preview Deployments (#2248)
Browse files Browse the repository at this point in the history
* fix: alias api deployments before health checks

* fix: seperate job

* version bump

* fix: add checkout step before healthcheck deployment
  • Loading branch information
0xemc authored Feb 8, 2024
1 parent 94eb65d commit a4bb916
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/deploy_carbonmark_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ jobs:
deploy_preview:
runs-on: ubuntu-latest
environment: Preview – carbonmark-api
outputs:
deployed_url: ${{ env.DEPLOYED_URL }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -65,8 +67,15 @@ jobs:
url="$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})"
echo "DEPLOYED_URL=$url" >> $GITHUB_ENV
- name: Healthcheck deployment
run: npx newman run carbonmark-api/postman_collection.json --env-var "url=${{ env.DEPLOYED_URL }}"

- name: Alias deployment
run: vercel alias --token=${{ secrets.VERCEL_TOKEN }} --scope=${{ secrets.VERCEL_TEAM_ID }} set "${{ env.DEPLOYED_URL }}" carbonmark-api-${{ env.SHORT_COMMIT_SHA }}-klimadao.vercel.app

healthcheck:
needs: deploy_preview
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Healthcheck deployment
run: npx newman run carbonmark-api/postman_collection.json --env-var "url=${{ needs.deploy_preview.outputs.deployed_url }}"
2 changes: 1 addition & 1 deletion carbonmark-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@klimadao/carbonmark-api",
"version": "6.1.1",
"version": "6.1.2",
"description": "An API for exploring Carbonmark project data, prices and activity.",
"main": "app.ts",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a4bb916

Please sign in to comment.