From f8cde647b1bb9c966dd209906026acbeec7aa6cc Mon Sep 17 00:00:00 2001 From: ange Date: Wed, 1 May 2024 12:19:54 +0200 Subject: [PATCH] feat: PROD_URL --- .env | 1 + .gitea/workflows/deploy.yaml | 11 ++++++++--- compose.yaml | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.env b/.env index 80f6d5d..d3c29b8 100644 --- a/.env +++ b/.env @@ -1 +1,2 @@ +PROD_URL=searx.gmoker.com IMAGEAPP=docker.io/searxng/searxng:2024.4.30-f8bdf6197 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 diff --git a/compose.yaml b/compose.yaml index a8b7b3f..a0c4660 100644 --- a/compose.yaml +++ b/compose.yaml @@ -12,7 +12,7 @@ services: ports: - "8080:8080" environment: - - SEARXNG_SECRET=secret + - SEARXNG_SECRET=secret # $(openssl rand -hex 32) volumes: - ./limiter.toml:/etc/searxng/limiter.toml:ro - ./settings.yml:/etc/searxng/settings.yml:ro