Skip to content

Commit 8d2303d

Browse files
committed
Add action to deploy PRs to preview app.
1 parent b320d97 commit 8d2303d

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/fly-preview.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Deploy Review App
2+
on:
3+
# Run this workflow on every PR event. Existing review apps will be updated when the PR is updated.
4+
pull_request:
5+
types: [opened, reopened, synchronize, closed]
6+
7+
env:
8+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
9+
# Set these to your Fly.io organization and preferred region.
10+
FLY_REGION: iad
11+
FLY_ORG: a-lloyd-flanagan-he-him
12+
13+
jobs:
14+
review_app:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
url: ${{ steps.deploy.outputs.url }}
18+
# Only run one deployment at a time per PR.
19+
concurrency:
20+
group: pr-${{ github.event.number }}
21+
22+
# Deploying apps with this "review" environment allows the URL for the app to be displayed in the PR UI.
23+
# Feel free to change the name of this environment.
24+
environment:
25+
name: review
26+
# The script in the `deploy` sets the URL output for each review app.
27+
url: ${{ steps.deploy.outputs.url }}
28+
steps:
29+
- name: Get code
30+
uses: actions/checkout@v4
31+
32+
- name: Deploy PR app to Fly.io
33+
id: deploy
34+
uses: superfly/[email protected]
35+

0 commit comments

Comments
 (0)