Skip to content

Commit

Permalink
Added GitHub action to start preview app.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixxm committed Nov 30, 2023
1 parent 06c5cb1 commit ae690bf
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/fly_pr_preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Start preview app

on:
pull_request:
types: [labeled, synchronize, opened, reopened, close]
paths-ignore:
- 'docs/**'

concurrency:
group: ${{ github.workflow }}-pr-${{ github.event.number }}
cancel-in-progress: true

permissions:
contents: read

env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
FLY_REGION: waw
FLY_ORG: personal

jobs:
preview-app:
if: contains(github.event.pull_request.labels.*.name, 'PR preview app')
runs-on: ubuntu-latest
name: Preview app
environment:
name: pr-${{github.event.number }}
url: ${{ steps.deploy.outputs.url }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Deploy preview app
uses: superfly/[email protected]
id: deploy
1 change: 1 addition & 0 deletions django/views/templates/default_urlconf.html
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@
<path class="flame" d="M250.27 178.834l-5.32-8.93s-2.47-5.7 3.458-6.118h10.26s6.232.266 3.306 6.194l-5.244 8.93s-3.23 4.37-6.46 0v-.076z" fill="#AA2247"/>
</svg>
<h1>{% translate "The install worked successfully! Congratulations!" %}</h1>
<h2>🎈 This is PR preview app, started on Fly.io 🎈<h2>
<p>{% blocktranslate %}You are seeing this page because <a href="https://docs.djangoproject.com/en/{{ version }}/ref/settings/#debug" target="_blank" rel="noopener">DEBUG=True</a> is in your settings file and you have not configured any URLs.{% endblocktranslate %}</p>
</main>
<footer>
Expand Down

0 comments on commit ae690bf

Please sign in to comment.