Skip to content

Commit 28f0273

Browse files
committed
chore(deploy): streamline Fly.io pipeline and harden container build
Signed-off-by: JmPotato <github@ipotato.me>
1 parent e005a4d commit 28f0273

File tree

6 files changed

+3440
-38
lines changed

6 files changed

+3440
-38
lines changed

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
target/
2+
.git/
3+
.github/
4+
.gitignore
5+
*.md

.github/workflows/fly-deploy.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,32 @@
11
# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/
22

3-
name: Fly.io Demo Deploy
3+
name: Deploy to Fly.io
44
on:
55
push:
66
branches:
77
- main
8+
9+
concurrency:
10+
group: deploy
11+
cancel-in-progress: true
12+
813
jobs:
914
deploy:
1015
name: Deploy app
1116
runs-on: ubuntu-latest
12-
concurrency: deploy-group # optional: ensure only one action runs at a time
1317
steps:
14-
- uses: actions/checkout@v4
15-
- uses: superfly/flyctl-actions/setup-flyctl@master
16-
- env:
18+
- uses: actions/checkout@v6
19+
- name: Install fly
20+
run: |
21+
curl -L https://fly.io/install.sh | sh
22+
echo "$HOME/.fly/bin" >> "$GITHUB_PATH"
23+
- name: Set secrets
24+
run: fly secrets set --stage MYSQL_CONNECTION_URL="${MYSQL_CONNECTION_URL}" UMAMI_ID="${UMAMI_ID}"
25+
env:
1726
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
1827
MYSQL_CONNECTION_URL: ${{ secrets.MYSQL_CONNECTION_URL }}
1928
UMAMI_ID: ${{ secrets.UMAMI_ID }}
20-
run: |
21-
flyctl secrets set --stage MYSQL_CONNECTION_URL=${MYSQL_CONNECTION_URL} UMAMI_ID=${UMAMI_ID}
22-
flyctl deploy --remote-only
29+
- name: Deploy
30+
run: fly deploy --remote-only
31+
env:
32+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ target/
55

66
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
77
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
8-
Cargo.lock
8+
# Cargo.lock
99

1010
# These are backup files generated by rustfmt
1111
**/*.rs.bk

0 commit comments

Comments
 (0)