Skip to content

Commit

Permalink
test run with temp docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan-Skvortsov committed Aug 15, 2023
1 parent 840d38a commit 9775a31
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/deploy_stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ jobs:
host: ${{ secrets.HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
# passphrase: ${{ secrets.SSH_PASSPHRASE }}
port: ${{ secrets.SSH_PORT }}
source: "infra/docker-compose.stage.yaml,infra/nginx/nginx.stage.conf"
target: ${{ env.DEPLOY_PATH }}
Expand All @@ -84,12 +83,14 @@ jobs:
host: ${{ secrets.HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
# passphrase: ${{ secrets.SSH_PASSPHRASE }}
port: ${{ secrets.SSH_PORT }}
script: |
cd ${{ env.DEPLOY_PATH }}
rm -f infra/.env
touch infra/.env
echo APPLICATION_URL=${{ secrets.APPLICATION_URL }} >> infra/.env
echo DJANGO_SECRET_KEY=$'${{ secrets.DJANGO_SECRET_KEY }}' >> infra/.env
echo DJANGO_ALLOWED_HOSTS=${{ secrets.DJANGO_ALLOWED_HOSTS }} >> infra/.env
echo CSRF_TRUSTED_ORIGINS=${{ secrets.CSRF_TRUSTED_ORIGINS }} >> infra/.env
Expand All @@ -102,7 +103,8 @@ jobs:
echo POSTGRES_PORT=${{ secrets.POSTGRES_PORT }} >> infra/.env
sudo docker image prune -f
sudo docker pull ${{ env.REGISTRY }}/${{ env.REP_OWNER }}/${{ env.IMAGE_NAME }}:latest
# sudo docker pull ${{ env.REGISTRY }}/${{ env.REP_OWNER }}/${{ env.IMAGE_NAME }}:latest
sudo docker pull profcheg/b2bmarketplace
sudo docker compose --file infra/docker-compose.stage.yaml stop
sudo docker compose --file infra/docker-compose.stage.yaml rm backend
sudo docker compose --file infra/docker-compose.stage.yaml up -d
4 changes: 3 additions & 1 deletion infra/docker-compose.stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ services:
retries: 5

backend:
image: ghcr.io/b2b-marketplace/b2b_marketplace_backend:latest
# TODO: забирать с гитхаба, когда пакет сделают публичным
# image: ghcr.io/b2b-marketplace/b2b_marketplace_backend:latest
image: profcheg/b2bmarketplace
container_name: b2b_marketplace_backend
command: >
sh -c "python manage.py migrate &&
Expand Down

0 comments on commit 9775a31

Please sign in to comment.