Skip to content

Commit d77750e

Browse files
authored
FEAT: Deployment status (#23)
* deploy: Updates deploy workflow to create a GH deployment status in the repo * chore: Removes .vscode, because it was just using defaults
1 parent bee8f5f commit d77750e

File tree

2 files changed

+35
-4
lines changed

2 files changed

+35
-4
lines changed

.github/workflows/deploy.yml

+35-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
21
name: 🚀 Deploy to Fly
32
on:
43
workflow_dispatch:
54
push:
65
branches:
76
- main
7+
88
jobs:
99
deploy:
1010
name: Deploy app
@@ -13,9 +13,43 @@ jobs:
1313
steps:
1414
- name: Checkout 🛎️
1515
uses: actions/checkout@v4
16+
1617
- name: Setup Fly 🧰
1718
uses: superfly/flyctl-actions/setup-flyctl@master
19+
1820
- name: Deploy to Fly.io 🛩️
21+
id: deploy
1922
run: flyctl deploy --remote-only
2023
env:
2124
FLY_API_TOKEN: ${{ secrets.FLY_TOKEN }}
25+
26+
- name: Create GitHub Deployment Status 🚢
27+
id: create_deployment
28+
uses: peter-evans/create-or-update-deployment@v1
29+
with:
30+
token: ${{ secrets.GITHUB_TOKEN }}
31+
environment: production
32+
environment_url: https://api.web-check.xyz
33+
description: "Deploying the application to Fly.io"
34+
transient_environment: false
35+
auto_inactive: true
36+
37+
- name: Update GitHub Deployment Status to Success ✅
38+
if: success()
39+
uses: octokit/request-action@v2
40+
with:
41+
route: POST /repos/${{ github.repository }}/deployments/${{ steps.create_deployment.outputs.deployment_id }}/statuses
42+
token: ${{ secrets.GITHUB_TOKEN }}
43+
state: success
44+
environment_url: https://api.web-check.xyz
45+
description: '✅ Deployment successful! 🥳'
46+
47+
- name: Update GitHub Deployment Status to Failure 🚫
48+
if: failure()
49+
uses: octokit/request-action@v2
50+
with:
51+
route: POST /repos/${{ github.repository }}/deployments/${{ steps.create_deployment.outputs.deployment_id }}/statuses
52+
token: ${{ secrets.GITHUB_TOKEN }}
53+
state: failure
54+
environment_url: https://api.web-check.xyz
55+
description: '🚫 Deployment failed 😥'

.vscode/settings.json

-3
This file was deleted.

0 commit comments

Comments
 (0)