-
-
Notifications
You must be signed in to change notification settings - Fork 5
56 lines (51 loc) · 1.78 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: 🚀 Deploy to Fly
on:
workflow_dispatch:
push:
branches:
- main
jobs:
deploy:
name: Deploy app
runs-on: ubuntu-latest
concurrency: deploy-group
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Setup Fly 🧰
uses: superfly/flyctl-actions/setup-flyctl@master
- name: Create GitHub Deployment 🐙
id: create_deployment
uses: octokit/request-action@v2.3.1
with:
route: POST /repos/${{ github.repository }}/deployments
environment: production
ref: ${{ github.sha }}
description: "Deploying to Fly.io"
auto_merge: false
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN || secrets.GITHUB_TOKEN }}
- name: Deploy to Fly.io 🛩️
run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_TOKEN }}
- name: Set deployment status to success ✅
if: success()
uses: octokit/request-action@v2.3.1
with:
route: POST /repos/${{ github.repository }}/deployments/${{ steps.create_deployment.outputs.id }}/statuses
state: success
description: "✅ Deployment Succeeded 🥳"
environment: production
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN || secrets.GITHUB_TOKEN }}
- name: Set deployment status to failure ❌
if: failure()
uses: octokit/request-action@v2.3.1
with:
route: POST /repos/${{ github.repository }}/deployments/${{ steps.create_deployment.outputs.id }}/statuses
state: failure
description: "❌ Deployment Failed 😥"
environment: production
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN || secrets.GITHUB_TOKEN }}