-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (35 loc) · 1.21 KB
/
Copy pathdeploy.yml
File metadata and controls
41 lines (35 loc) · 1.21 KB
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
name: Deploy to Fly.io
# Optional release deploy for the reference demo. Skips cleanly when
# FLY_API_TOKEN is unset. Requires fly.toml + Dockerfile.
on:
release:
types: [published]
workflow_dispatch:
permissions:
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Check Fly token
id: fly
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
run: |
if [ -z "${FLY_API_TOKEN}" ]; then
echo "configured=false" >> "$GITHUB_OUTPUT"
echo "FLY_API_TOKEN secret is not set — skipping deploy."
else
echo "configured=true" >> "$GITHUB_OUTPUT"
fi
# setup-flyctl only publishes @master (not version tags); pin the commit.
- name: Set up Flyctl
if: steps.fly.outputs.configured == 'true'
uses: superfly/flyctl-actions/setup-flyctl@ed8efb33836e8b2096c7fd3ba1c8afe303ebbff1 # master
- name: Deploy
if: steps.fly.outputs.configured == 'true'
run: flyctl deploy --remote-only --strategy=rolling
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}