Set hosts and origins during review app predeploy

This commit is contained in:
Christopher C. Wells 2022-11-06 06:02:24 -08:00
parent eae11b5f63
commit 841d6562de
2 changed files with 5 additions and 4 deletions

View File

@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
environment:
name: pr-${{ github.event.pull_request.number }}
url: https://pr-${{ github.event.pull_request.number }}.dokku.baby-buddy.net
url: http://pr-${{ github.event.pull_request.number }}.dokku.baby-buddy.net
if: github.event.action == 'labeled' && github.event.label.name == 'to review'
steps:
- uses: actions/checkout@v3
@ -26,7 +26,7 @@ jobs:
runs-on: ubuntu-latest
environment:
name: pr-${{ github.event.pull_request.number }}
url: https://pr-${{ github.event.pull_request.number }}.dokku.baby-buddy.net
url: http://pr-${{ github.event.pull_request.number }}.dokku.baby-buddy.net
if: github.event.action == 'unlabeled' && github.event.label.name == 'to review'
steps:
- name: Destroy review app

View File

@ -1,6 +1,7 @@
#!/bin/sh -l
if [ "$IS_REVIEW_APP" = "true" ]; then
ssh "$SSH_REMOTE" -- config:set "$APP_NAME" "DOMAIN=$APP_NAME.dokku.baby-buddy.net"
echo "configured the review app domain"
DOMAIN="$APP_NAME.dokku.baby-buddy.net"
ssh "$SSH_REMOTE" -- config:set "$APP_NAME" "ALLOWED_HOSTS=$DOMAIN CSRF_TRUSTED_ORIGINS=http://$DOMAIN"
echo "Review app configured"
fi