From 0d6230cda7f8c5544b77ba274981072bcf758883 Mon Sep 17 00:00:00 2001 From: ange Date: Wed, 1 May 2024 12:16:38 +0200 Subject: [PATCH] feat: PROD_URL --- .env | 1 + .gitea/workflows/deploy.yaml | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.env b/.env index da404c9..88ae4ed 100644 --- a/.env +++ b/.env @@ -1 +1,2 @@ +PROD_URL=chat.gmoker.com IMAGEAPP=docker.io/vectorim/element-web:v1.11.65 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