From 500dda5f176d3613d70ae7a395bd35277933cc00 Mon Sep 17 00:00:00 2001 From: ange Date: Wed, 1 May 2024 12:04:16 +0200 Subject: [PATCH] feat: PROD_URL --- .env | 3 ++- .gitea/workflows/deploy.yaml | 11 ++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.env b/.env index 8f896fa..6066c80 100644 --- a/.env +++ b/.env @@ -1,4 +1,5 @@ +PROD_URL=matrix.k8s.gmoker.com IMAGEAPP=ghcr.io/element-hq/synapse:v1.105.0 -IMAGECOTURN=docker.io/coturn/coturn:4.6.2 TURN_URL=turn.test.gmoker.com +IMAGECOTURN=docker.io/coturn/coturn:4.6.2 diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 84fd1f6..70e6840 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -1,15 +1,20 @@ on: push jobs: - build: - name: test + deploy: runs-on: debian steps: - uses: actions/checkout@v1 - name: setup env run: | + . ./.env + if [ "${{ gitea.ref_name }}" == prod ] && [ -n "$PROD_URL" ]; then + BASE_URL="$PROD_URL" + else + BASE_URL="${{ gitea.ref_name }}.$(tr / '\n' <<< "${{ gitea.repository }}" | tac | tr '\n' .)k8s.gmoker.com" + fi cat <> .env - BASE_URL="${{ gitea.ref_name }}.$(tr / '\n' <<< "${{ gitea.repository }}" | tac | tr '\n' .)k8s.gmoker.com" + BASE_URL="$BASE_URL" EOF cat .env