Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add swag #36

Merged
merged 25 commits into from
May 19, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions .github/workflows/deploy_stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ env:
IMAGE_NAME: procharity_back_2.0_backend
DEPLOY_PATH: /procharity2/full
WORK_DIR: /app
APPLICATION_URL: ${{ secrets.APPLICATION_URL }}
Aleksey-shipkov marked this conversation as resolved.
Show resolved Hide resolved
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}

defaults:
run:
Expand Down Expand Up @@ -111,26 +113,18 @@ jobs:
password: ${{ secrets.SSH_PASSWORD }}
script: |
cd ${{ env.DEPLOY_PATH }}/infra
export APPLICATION_URL=${{ secrets.APPLICATION_URL }}
export POSTGRES_USER=${{ secrets.POSTGRES_USER }}
docker image prune -f
docker pull ${{ env.REGISTRY }}/${{ env.REP_OWNER }}/${{ env.IMAGE_NAME }}:latest
docker compose --file docker-compose.yaml stop
docker compose --file docker-compose.yaml rm backend
docker stop $(docker ps -aq)
docker container ls -q | xargs --no-run-if-empty docker container rm -f
docker compose --file docker-compose.yaml --env-file ../.env up -d --remove-orphans
docker pull ${{ env.REGISTRY }}/${{ env.REP_OWNER }}/${{ env.IMAGE_NAME }}:latest
docker compose --file docker-compose.yaml --env-file ../.env up -d
docker system prune -a -f
- name: Making migrations
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
script: |
export APPLICATION_URL=${{ secrets.APPLICATION_URL }}
export POSTGRES_USER=${{ secrets.POSTGRES_USER }}
cd ${{ env.DEPLOY_PATH }}/infra
docker compose exec -T -w ${{ env.WORK_DIR }} backend alembic upgrade head
docker compose --env-file ../.env exec -T -w ${{ env.WORK_DIR }} backend alembic upgrade head
- name: Sleep for 30 seconds
run: sleep 30s
shell: bash