Skip to content

Commit

Permalink
Merge pull request #429 from Trombach/fix/wait-for-vercel
Browse files Browse the repository at this point in the history
wait for vercel staging deployment to finish before promoting
  • Loading branch information
Trombach authored Oct 10, 2024
2 parents 8c3ecc1 + a05dc5f commit 7747cc9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/weak-files-beam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"homepage": patch
---

wait for vercel staging deployment to finish before promoting
21 changes: 17 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,25 @@ jobs:
- name: Get latest staging ID
id: get-staging-id
run: |
uid=`curl -X GET "https://api.vercel.com/v6/deployments?app=astro-homepage" \
response=`curl -X GET "https://api.vercel.com/v6/deployments?app=astro-homepage" \
-H "Authorization: Bearer ${{ secrets.VERCEL_TOKEN }}" \
-H "Content-Type: application/json" \
| jq -r '.deployments[] | select(.meta.githubCommitSha == "${{ github.sha }}") | .uid'`
echo $uid
echo "id=$uid" >> "$GITHUB_OUTPUT"
| jq '.deployments[] | select(.meta.githubCommitSha == "${{ github.sha }}")'`
url=$(echo response | jq -r '.url')
message=$(echo response | jq -r '.meta.githubCommitMessage')
echo $url
echo $message
echo "id=$url" >> "$GITHUB_OUTPUT"
echo "message=$message" >> "$GITHUB_OUTPUT"
- uses: UnlyEd/github-action-await-vercel@v2
if: ${{ steps.get-staging-id.outputs.id == 'Version Packages' }}
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
with:
deployment-url: ${{ steps.get-staging-id.outputs.id }}
timeout: 120
poll-interval: 5
- name: Create Release PR
uses: changesets/action@v1
with:
Expand Down

1 comment on commit 7747cc9

@vercel
Copy link

@vercel vercel bot commented on 7747cc9 Oct 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

astro-homepage – ./

astro-homepage-git-main-trombachs-projects.vercel.app
astro-homepage-trombachs-projects.vercel.app

Please sign in to comment.