Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable external contributors to create previews #1068

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add fly-destroy workflow
  • Loading branch information
SleepyLeslie committed Jun 28, 2024
commit 9d1121a463d619e38d499d4039684954b2c22d46
2 changes: 1 addition & 1 deletion .github/workflows/fly-cleanup.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Fly Cleanup
name: fly.io Cleanup
on:
schedule:
# Once a day, clean up jobs marked as expired
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/fly-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:

jobs:
deploy:
name: Deploy app to fly.io
runs-on: ubuntu-latest
if: |
github.event.workflow_run.event == 'pull_request' &&
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/fly-destroy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: fly.io Destroy
on:
pull_request_target:
branches: [ main ]
types: [labeled, unlabeled, closed, opened, synchronize, reopened]

# Allows running this workflow manually from the Actions tab
workflow_dispatch:

env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

jobs:
destroy:
name: Remove app from fly.io
runs-on: ubuntu-latest
# Remove the deployment when 'preview' label is removed, or the PR is closed.
if: |
github.repository_owner == 'gristlabs' &&
github.event_name == 'pull_request' &&
(github.event.action == 'closed' ||
(github.event.action == 'unlabeled' && github.event.label.name == 'preview'))
steps:
- uses: actions/checkout@v3
- uses: superfly/flyctl-actions/setup-flyctl@master
with:
version: 0.1.89
- id: fly_destroy
run: node buildtools/fly-deploy.js destroy
64 changes: 0 additions & 64 deletions .github/workflows/fly.yml

This file was deleted.

Loading