Skip to content

Commit

Permalink
chore: allow deployment in production
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael0202 committed Nov 29, 2023
1 parent b4d7658 commit 0888291
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
1 change: 0 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ MEM_LIMIT=4294967296

# on dev connect to the same network as off-server
COMMON_NET_NAME=po_default
OPENFOODFACTS_API_URL=http://world.openfoodfacts.localhost

# Sentry DNS for bug tracking, used only in staging and production
SENTRY_DNS=
Expand Down
21 changes: 11 additions & 10 deletions .github/workflows/container-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ on:
branches:
- main
- deploy-*
# only staging for now, not prod
# tags:
# - v*.*.*
tags:
- v*.*.*


# Note on secrets used for connection
Expand All @@ -30,15 +29,18 @@ jobs:
environment: ${{ matrix.env }}
concurrency: ${{ matrix.env }}
steps:
- name: Set common variables
run: |
echo "SSH_PROXY_HOST=ovh1.openfoodfacts.org" >> $GITHUB_ENV
echo "SSH_USERNAME=off" >> $GITHUB_ENV
- name: Set various variable for staging (net) deployment
if: matrix.env == 'off-search-net'
run: |
# direct container access
echo "OPENFOODFACTS_API_URL=https://off:[email protected]" >> $GITHUB_ENV
# deploy target
echo "SSH_HOST=10.1.0.200" >> $GITHUB_ENV
echo "SSH_PROXY_HOST=ovh1.openfoodfacts.org" >> $GITHUB_ENV
echo "SSH_USERNAME=off" >> $GITHUB_ENV
- name: Set various variable for production deployment
if: matrix.env == 'robotoff-org'
run: |
echo "SSH_HOST=10.1.0.201" >> $GITHUB_ENV
- name: Wait for search image container build workflow
uses: tomchv/[email protected]
id: wait-build
Expand Down Expand Up @@ -120,9 +122,8 @@ jobs:
echo "MEM_LIMIT=4294967296" >> .env
# this is the network shared with productopener
echo "COMMON_NET_NAME=po_webnet">> .env
echo "OPENFOODFACTS_API_URL=${{ env.OPENFOODFACTS_API_URL }}" >> .env
# This secret is to be generated using htpasswd, see .env file
# use simple quotes to avoid interpolation of $apr1$ !
# use simple quotes to avoid interpolation of $apr1$!
echo 'NGINX_BASIC_AUTH_USER_PASSWD=${{ secrets.NGINX_BASIC_AUTH_USER_PASSWD }}' >> .env
echo "SENTRY_DNS=${{ secrets.SENTRY_DSN }}" >> .env
echo "CONFIG_PATH=data/config/openfoodfacts.yml" >> .env
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ x-api-common: &api-common
environment:
- ELASTICSEARCH_URL=http://es01:9200
- REDIS_HOST=redis
- OPENFOODFACTS_API_URL
- SENTRY_DNS
- LOG_LEVEL
# Directory where we cache downloaded taxonomies files
Expand Down

0 comments on commit 0888291

Please sign in to comment.