Skip to content

Commit 23a877c

Browse files
Create deploy.yml
1 parent f93532d commit 23a877c

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Deploy to Fly.io
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout main
14+
uses: actions/checkout@v4
15+
with:
16+
ref: main
17+
fetch-depth: 0
18+
19+
- name: Set up Git
20+
run: |
21+
git config user.name "github-actions[bot]"
22+
git config user.email "github-actions[bot]@users.noreply.github.com"
23+
24+
- name: Fetch deployment branch
25+
run: git fetch origin deployment:deployment
26+
27+
- name: Attempt merge
28+
id: merge_attempt
29+
run: |
30+
git checkout deployment
31+
git merge origin/main --no-edit || echo "MERGE_FAILED=true" >> $GITHUB_ENV
32+
33+
- name: Push to deployment branch
34+
if: env.MERGE_FAILED != 'true'
35+
run: |
36+
git push origin deployment
37+
38+
- name: Deploy to Fly.io
39+
if: env.MERGE_FAILED != 'true'
40+
uses: superfly/flyctl-actions@1.4
41+
with:
42+
args: deploy --remote-only
43+
env:
44+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

0 commit comments

Comments
 (0)