feat: PROD_URL

This commit is contained in:
ange 2024-05-01 12:19:54 +02:00
parent 4c06b487b3
commit f8cde647b1
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D
3 changed files with 10 additions and 4 deletions

1
.env
View File

@ -1 +1,2 @@
PROD_URL=searx.gmoker.com
IMAGEAPP=docker.io/searxng/searxng:2024.4.30-f8bdf6197 IMAGEAPP=docker.io/searxng/searxng:2024.4.30-f8bdf6197

View File

@ -1,15 +1,20 @@
on: push on: push
jobs: jobs:
build: deploy:
name: test
runs-on: debian runs-on: debian
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: setup env - name: setup env
run: | 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 <<EOF >> .env cat <<EOF >> .env
BASE_URL="${{ gitea.ref_name }}.$(tr / '\n' <<< "${{ gitea.repository }}" | tac | tr '\n' .)k8s.gmoker.com" BASE_URL="$BASE_URL"
EOF EOF
cat .env cat .env

View File

@ -12,7 +12,7 @@ services:
ports: ports:
- "8080:8080" - "8080:8080"
environment: environment:
- SEARXNG_SECRET=secret - SEARXNG_SECRET=secret # $(openssl rand -hex 32)
volumes: volumes:
- ./limiter.toml:/etc/searxng/limiter.toml:ro - ./limiter.toml:/etc/searxng/limiter.toml:ro
- ./settings.yml:/etc/searxng/settings.yml:ro - ./settings.yml:/etc/searxng/settings.yml:ro