Skip to content

Commit a856eff

Browse files
authored
FEAT: Deployment status (#25)
1 parent d32f1cd commit a856eff

File tree

1 file changed

+20
-26
lines changed

1 file changed

+20
-26
lines changed

.github/workflows/deploy.yml

+20-26
Original file line numberDiff line numberDiff line change
@@ -9,48 +9,42 @@ jobs:
99
name: Deploy app
1010
runs-on: ubuntu-latest
1111
concurrency: deploy-group
12+
permissions:
13+
deployments: write
1214
steps:
1315
- name: Checkout 🛎️
1416
uses: actions/checkout@v4
1517

1618
- name: Setup Fly 🧰
1719
uses: superfly/flyctl-actions/setup-flyctl@master
1820

19-
- name: Create GitHub Deployment 🐙
20-
id: create_deployment
21-
uses: octokit/request-action@v2.3.1
21+
- name: Create GitHub deployment 🐙
22+
uses: chrnorm/deployment-action@v2
23+
id: deployment
2224
with:
23-
route: POST /repos/${{ github.repository }}/deployments
25+
token: ${{ secrets.BOT_TOKEN || secrets.GITHUB_TOKEN }}
26+
environment-url: http://api.web-check.xyz
2427
environment: production
25-
ref: ${{ github.sha }}
26-
description: "Deploying to Fly.io"
27-
auto_merge: false
28-
env:
29-
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN || secrets.GITHUB_TOKEN }}
3028

3129
- name: Deploy to Fly.io 🛩️
3230
run: flyctl deploy --remote-only
3331
env:
3432
FLY_API_TOKEN: ${{ secrets.FLY_TOKEN }}
35-
36-
- name: Set deployment status to success ✅
33+
34+
- name: Update deployment status (success)
3735
if: success()
38-
uses: octokit/request-action@v2.3.1
36+
uses: chrnorm/deployment-status@v2
3937
with:
40-
route: POST /repos/${{ github.repository }}/deployments/${{ steps.create_deployment.outputs.id }}/statuses
41-
state: success
42-
description: "✅ Deployment Succeeded 🥳"
43-
environment: production
44-
env:
45-
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN || secrets.GITHUB_TOKEN }}
38+
token: ${{ secrets.BOT_TOKEN || secrets.GITHUB_TOKEN }}
39+
environment-url: ${{ steps.deployment.outputs.environment_url }}
40+
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
41+
state: 'success'
4642

47-
- name: Set deployment status to failure ❌
43+
- name: Update deployment status (failure)
4844
if: failure()
49-
uses: octokit/request-action@v2.3.1
45+
uses: chrnorm/deployment-status@v2
5046
with:
51-
route: POST /repos/${{ github.repository }}/deployments/${{ steps.create_deployment.outputs.id }}/statuses
52-
state: failure
53-
description: "❌ Deployment Failed 😥"
54-
environment: production
55-
env:
56-
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN || secrets.GITHUB_TOKEN }}
47+
token: ${{ secrets.BOT_TOKEN || secrets.GITHUB_TOKEN }}
48+
environment-url: ${{ steps.deployment.outputs.environment_url }}
49+
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
50+
state: 'failure'

0 commit comments

Comments
 (0)