From 1dc2b68e2afcf70b129e9bedb2cf2d4be55b91ee Mon Sep 17 00:00:00 2001 From: MiniDigger | Martin Date: Fri, 23 Dec 2022 16:03:42 +0100 Subject: [PATCH] fix(build): choose backend data host depending on branch --- .github/workflows/deploy.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 88a27c91..d39540e5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -94,13 +94,20 @@ jobs: # env: # CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} + - name: Set environment for branch + run: | + if [[ $GITHUB_REF == 'refs/heads/master' ]]; then + echo "BACKEND_DATA_HOST=https://hangar.papermc.io" >> "$GITHUB_ENV" + else + echo "BACKEND_DATA_HOST=https://hangar.papermc.dev" >> "$GITHUB_ENV" + fi + - name: Build frontend env: # keep these in sync with compose! BACKEND_HOST: "http://hangar_backend:8080" AUTH_HOST: "https://hangar-auth.papermc.dev" PUBLIC_HOST: "https://hangar.papermc.dev" - BACKEND_DATA_HOST: "https://hangar.papermc.dev" DEBUG: "hangar:*" run: (cd frontend && pnpm build)