Skip to content

Commit dc8876b

Browse files
authored
ci: 👷 deploy to Fly isn't working well, plus move out env deletion to own file (#7)
## Description Fly is using a lot more resources than I expected, so commenting this out since we don't need it yet. Plus there's things to fix before it works better. Closes seedcase-project/.github#166 ## Reviewer Focus <!-- Select quick/in-depth as necessary --> This PR doesn't need a review, it's only commenting things out.
1 parent da81016 commit dc8876b

File tree

3 files changed

+68
-46
lines changed

3 files changed

+68
-46
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Delete GitHub environment after merging
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
branches:
7+
- main
8+
9+
jobs:
10+
delete-environment:
11+
# TODO: Remove this `if` and fix the workflow once we start deploying to Fly again.
12+
if: false
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
# TODO: This wasn't working correctly.
19+
# This removes left over environments in GitHub from the building and deploying.
20+
- name: Clean up GitHub environment
21+
run: |
22+
gh api \
23+
--method DELETE \
24+
-H "Accept: application/vnd.github+json" \
25+
-H "X-GitHub-Api-Version: 2022-11-28" \
26+
/repos/seedcase-project/${{ github.event.repository.name }}/environments/pr-${{ github.event.number }}
27+
env:
28+
GH_TOKEN: ${{ secrets.DELETE_ENV_TOKEN }}

.github/workflows/deploy-demo.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ jobs:
2828
uses: seedcase-project/.github/.github/workflows/test.yml@main
2929
needs: lint
3030

31-
deploy:
32-
name: Deploy app
33-
runs-on: ubuntu-latest
34-
needs: test
31+
# deploy:
32+
# name: Deploy app
33+
# runs-on: ubuntu-latest
34+
# needs: test
3535

36-
concurrency: deploy-group # optional: ensure only one action runs at a time
37-
steps:
38-
- uses: actions/checkout@v4
36+
# concurrency: deploy-group # optional: ensure only one action runs at a time
37+
# steps:
38+
# - uses: actions/checkout@v4
3939

40-
- name: Deploy to Fly.io
41-
uses: superfly/flyctl-actions/setup-flyctl@master
42-
- run: flyctl deploy --remote-only
43-
env:
44-
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
40+
# - name: Deploy to Fly.io
41+
# uses: superfly/flyctl-actions/setup-flyctl@master
42+
# - run: flyctl deploy --remote-only
43+
# env:
44+
# FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

.github/workflows/deploy-pr-preview.yml

Lines changed: 28 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Deploy PR Preview App
33

44
on:
55
pull_request:
6-
types: [opened, reopened, synchronize, closed]
6+
types: [opened, reopened, synchronize]
77
branches:
88
- main
99
paths-ignore:
@@ -22,10 +22,10 @@ on:
2222
- _publish.yml
2323
- _extensions/**
2424

25-
env:
26-
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
27-
FLY_REGION: ams
28-
FLY_ORG: seedcase-project
25+
# env:
26+
# FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
27+
# FLY_REGION: ams
28+
# FLY_ORG: seedcase-project
2929

3030
jobs:
3131
lint:
@@ -35,37 +35,31 @@ jobs:
3535
uses: seedcase-project/.github/.github/workflows/test.yml@main
3636
needs: lint
3737

38-
staging-app:
39-
runs-on: ubuntu-latest
40-
needs: test
38+
# staging-app:
39+
# runs-on: ubuntu-latest
40+
# needs: test
4141

42-
# Only run one deployment at a time per PR.
43-
concurrency:
44-
group: pr-${{ github.event.number }}
42+
# # Only run one deployment at a time per PR.
43+
# concurrency:
44+
# group: pr-${{ github.event.number }}
4545

46-
# Create a GitHub deployment environment per staging app so it shows up
47-
# in the pull request UI.
48-
environment:
49-
name: pr-${{ github.event.number }}
50-
url: ${{ steps.deploy.outputs.url }}
46+
# # Create a GitHub deployment environment per staging app so it shows up
47+
# # in the pull request UI.
48+
# environment:
49+
# name: pr-${{ github.event.number }}
50+
# url: ${{ steps.deploy.outputs.url }}
5151

52-
steps:
53-
- uses: actions/checkout@v4
52+
# steps:
53+
# - uses: actions/checkout@v4
5454

55-
- name: Deploy preview of PR
56-
id: deploy
57-
uses: superfly/fly-pr-review-apps@1.2.1
58-
with:
59-
name: ${{ github.event.repository.name }}-pr-${{ github.event.number }}
55+
# # Need to install direct from source, since their action is outdated
56+
# - name: Install Fly CLI
57+
# run: |
58+
# curl -L https://fly.io/install.sh | sh
59+
# echo "/home/runner/.fly/bin" >> $GITHUB_PATH
6060

61-
# This removes left over environments in GitHub from the building and deploying.
62-
- name: Clean up GitHub environment
63-
run: |
64-
gh api \
65-
--method DELETE \
66-
-H "Accept: application/vnd.github+json" \
67-
-H "X-GitHub-Api-Version: 2022-11-28" \
68-
/repos/seedcase-project/${{ github.event.repository.name }}/environments/pr-${{ github.event.number }}
69-
if: ${{ github.event.action == 'closed' }}
70-
env:
71-
GH_TOKEN: ${{ secrets.DELETE_ENV_TOKEN }}
61+
# - name: Deploy preview of PR
62+
# id: deploy
63+
# uses: ...
64+
# with:
65+
# name: ${{ github.event.repository.name }}-pr-${{ github.event.number }}

0 commit comments

Comments
 (0)