|
9 | 9 | name: Deploy app
|
10 | 10 | runs-on: ubuntu-latest
|
11 | 11 | concurrency: deploy-group
|
| 12 | + permissions: |
| 13 | + deployments: write |
12 | 14 | steps:
|
13 | 15 | - name: Checkout 🛎️
|
14 | 16 | uses: actions/checkout@v4
|
15 | 17 |
|
16 | 18 | - name: Setup Fly 🧰
|
17 | 19 | uses: superfly/flyctl-actions/setup-flyctl@master
|
18 | 20 |
|
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 |
22 | 24 | with:
|
23 |
| - route: POST /repos/${{ github.repository }}/deployments |
| 25 | + token: ${{ secrets.BOT_TOKEN || secrets.GITHUB_TOKEN }} |
| 26 | + environment-url: http://api.web-check.xyz |
24 | 27 | 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 }} |
30 | 28 |
|
31 | 29 | - name: Deploy to Fly.io 🛩️
|
32 | 30 | run: flyctl deploy --remote-only
|
33 | 31 | env:
|
34 | 32 | FLY_API_TOKEN: ${{ secrets.FLY_TOKEN }}
|
35 |
| - |
36 |
| - - name: Set deployment status to success ✅ |
| 33 | + |
| 34 | + - name: Update deployment status (success) ✅ |
37 | 35 | if: success()
|
38 |
| - uses: octokit/request-action@v2.3.1 |
| 36 | + uses: chrnorm/deployment-status@v2 |
39 | 37 | 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' |
46 | 42 |
|
47 |
| - - name: Set deployment status to failure ❌ |
| 43 | + - name: Update deployment status (failure) ❌ |
48 | 44 | if: failure()
|
49 |
| - uses: octokit/request-action@v2.3.1 |
| 45 | + uses: chrnorm/deployment-status@v2 |
50 | 46 | 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