Skip to content

Commit 9869f87

Browse files
committed
Merge remote-tracking branch 'origin' into notam
2 parents 4be13b2 + 27ab00f commit 9869f87

3 files changed

Lines changed: 45 additions & 21 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,3 @@ jobs:
2222
working-directory: remix
2323
- run: npm run icons
2424
- run: npm run test
25-
26-
deploy-preview:
27-
if: github.ref != 'refs/heads/master'
28-
env:
29-
FIREBASE_SERVICE_ACCOUNT_KEY: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_FLIGHTPLOT_WEB }}"
30-
SESSION_SECRET: ${{ secrets.SESSION_SECRET }}
31-
DEPLOYMENT_NAME: ${{ github.ref_name }}
32-
name: Deploy preview environment
33-
runs-on: ubuntu-latest
34-
steps:
35-
- uses: actions/checkout@v2
36-
- name: install myke
37-
run: |
38-
wget -qO /usr/local/bin/myke https://github.com/omio-labs/myke/releases/download/v1.0.2/myke_linux_amd64
39-
chmod +x /usr/local/bin/myke
40-
myke --version
41-
- uses: superfly/flyctl-actions/setup-flyctl@master
42-
- run: myke deploy-preview
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1+
name: Pull Request Closed
2+
13
on:
2-
- delete
4+
pull_request_target:
5+
types:
6+
- closed
37

48
defaults:
59
run:
610
working-directory: remix
711

812
jobs:
913
delete-preview:
10-
if: github.event.ref_type == 'branch'
1114
env:
1215
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
13-
DEPLOYMENT_NAME: ${{ github.event.ref }}
16+
DEPLOYMENT_NAME: ${{ github.head_ref }}
1417
name: Delete preview environment
1518
runs-on: ubuntu-latest
1619
steps:

.github/workflows/pull-request.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Pull Request (Re-)Opened & Updated
2+
3+
on:
4+
pull_request_target:
5+
6+
defaults:
7+
run:
8+
working-directory: remix
9+
10+
env:
11+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
12+
13+
jobs:
14+
deploy-preview:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
pull-requests: write
18+
env:
19+
FIREBASE_SERVICE_ACCOUNT_KEY: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_FLIGHTPLOT_WEB }}"
20+
SESSION_SECRET: ${{ secrets.SESSION_SECRET }}
21+
DEPLOYMENT_NAME: ${{ github.head_ref }}
22+
name: Deploy preview environment
23+
steps:
24+
- uses: actions/checkout@v2
25+
with:
26+
ref: ${{ github.event.pull_request.head.sha }}
27+
- name: install myke
28+
run: |
29+
wget -qO /usr/local/bin/myke https://github.com/omio-labs/myke/releases/download/v1.0.2/myke_linux_amd64
30+
chmod +x /usr/local/bin/myke
31+
myke --version
32+
- uses: superfly/flyctl-actions/setup-flyctl@master
33+
- run: myke deploy-preview
34+
- uses: mshick/add-pr-comment@v2
35+
with:
36+
message: |
37+
✅ Preview environment deployed at https://flightplot-preview-${{ github.head_ref }}.fly.dev/
38+
message-failure: |
39+
❌ Preview environment deployment failed.

0 commit comments

Comments
 (0)