From e19eafa8eb5e8b8031fa6916ddd3d228bef27157 Mon Sep 17 00:00:00 2001 From: Adibov Date: Wed, 29 Nov 2023 01:43:32 +0330 Subject: [PATCH] chore(compose): pass envs to docker compose on starting --- .github/workflows/deploy.yaml | 10 +++++++--- backend/.dockerignore | 3 ++- docker-compose.yml | 4 ++++ frontend/.dockerignore | 3 ++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index e7a81c4..d391560 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -2,8 +2,8 @@ name: Deploy on: push: - branches: - - master +# branches: +# - master jobs: build-and-push: @@ -45,10 +45,14 @@ jobs: - name: Deploy to the VM uses: appleboy/ssh-action@master + env: + SECRET_KEY: ${{ secrets.SECRET_KEY }} + EMAIL_HOST_PASSWORD: ${{ secrets.EMAIL_HOST_PASSWORD }} + ZIFY_AUTH: ${{ secrets.ZIFY_AUTH }} with: host: ${{ vars.VM_HOST }} username: ${{ vars.VM_USERNAME }} key: ${{ secrets.SSH_PRIVATE_KEY }} - # TODO: handle envs + envs: SECRET_KEY,EMAIL_HOST_PASSWORD,ZIFY_AUTH script: | docker compose -f AAISS-2023/docker-compose.yml up -d --pull always --force-recreate --no-build \ No newline at end of file diff --git a/backend/.dockerignore b/backend/.dockerignore index e4ea643..99f469b 100644 --- a/backend/.dockerignore +++ b/backend/.dockerignore @@ -1,4 +1,5 @@ .git data media -static \ No newline at end of file +static +.env \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index f93fab2..42dfa6c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,6 +21,10 @@ services: cache_from: - aaissaut/aaiss:backend command: gunicorn aaiss_backend.wsgi:application --bind 0.0.0.0:6446 + environment: + SECRET_KEY: ${SECRET_KEY} + EMAIL_HOST_PASSWORD: ${EMAIL_HOST_PASSWORD} + ZIFY_AUTH: ${ZIFY_AUTH} volumes: - ./backend/data:/backend-aaiss/data - ./backend/static:/backend-aaiss/static diff --git a/frontend/.dockerignore b/frontend/.dockerignore index c4e72ca..7eadf43 100644 --- a/frontend/.dockerignore +++ b/frontend/.dockerignore @@ -2,4 +2,5 @@ .gitignore README.md dist -node_modules \ No newline at end of file +node_modules +.env \ No newline at end of file