From 6660c17b3416c94c6674ced41c785ef7f41d9ff7 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Thu, 30 Nov 2023 13:18:22 +0100 Subject: [PATCH 1/2] Added GitHub action to start preview app. --- .github/workflows/fly_pr_preview.yml | 34 +++++++++++++++++++++ django/views/templates/default_urlconf.html | 1 + 2 files changed, 35 insertions(+) create mode 100644 .github/workflows/fly_pr_preview.yml diff --git a/.github/workflows/fly_pr_preview.yml b/.github/workflows/fly_pr_preview.yml new file mode 100644 index 000000000000..b52ad417c2ab --- /dev/null +++ b/.github/workflows/fly_pr_preview.yml @@ -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/fly-pr-review-apps@1.0.0 + id: deploy diff --git a/django/views/templates/default_urlconf.html b/django/views/templates/default_urlconf.html index 6bb170cc6761..72ae860e7e6a 100644 --- a/django/views/templates/default_urlconf.html +++ b/django/views/templates/default_urlconf.html @@ -218,6 +218,7 @@

{% translate "The install worked successfully! Congratulations!" %}

+

🎈 This is PR preview app, started on Fly.io 🎈

{% blocktranslate %}You are seeing this page because DEBUG=True is in your settings file and you have not configured any URLs.{% endblocktranslate %}