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