Skip to content

Commit

Permalink
Merge pull request #6 from Chao-Ma5566/feat-add-github-action
Browse files Browse the repository at this point in the history
refactor: remake step deploy
  • Loading branch information
Chao-Ma5566 authored Jun 18, 2024
2 parents 3aa2e70 + d967854 commit 2ebe233
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,24 @@ jobs:
run: npm install

- name: Deploy to Render
uses: bounceapp/[email protected]
with:
render-token: ${{ secrets.RENDER_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
env:
RENDER_API_KEY: ${{ secrets.RENDER_API_KEY }}
run: |
curl -X POST \
-H "Authorization: Bearer $RENDER_API_KEY" \
-H "Content-Type: application/json" \
--data '{"serviceId": "srv-cpoos62j1k6c73ac1420"}' \
https://api.render.com/v1/services/YOUR_RENDER_SERVICE_ID/deploys
- name: Create Deployment Status
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -X POST \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Content-Type: application/json" \
-d '{"state": "success", "target_url": "https://api.render.com/v1/services/YOUR_RENDER_SERVICE_ID/deploys", "description": "Deployment to Render successful", "context": "continuous-integration/render"}' \
https://api.github.com/repos/OWNER/REPO/statuses/COMMIT_SHA
- name: Notify deployment status
if: success()
Expand Down

0 comments on commit 2ebe233

Please sign in to comment.