Fix db bug #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: cafe_azu_workflow | |
on: | |
push: | |
branches: [ develop ] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: executing remote ssh commands to deploy | |
uses: appleboy/ssh-action@master | |
with: | |
host: 62.84.124.68 | |
username: ${{ secrets.USER }} | |
key: ${{ secrets.SSH_KEY }} | |
passphrase: ${{ secrets.PASSPHRASE }} | |
script: | | |
sudo docker compose stop | |
sudo docker compose rm -f ${{ secrets.USER }}/backend ${{ secrets.USER }}/frontend | |
sudo docker image rm -f ${{ secrets.DOCKER_USERNAME }}/azu_cafe_django ${{ secrets.DOCKER_USERNAME }}/azu_cafe_aiogram | |
rm .env | |
touch .env | |
echo TOKEN=${{ secrets.TOKEN }} >> .env | |
echo ADMIN_ID=${{ secrets.ADMIN_ID }} >> .env | |
echo PROVIDER_TOKEN=${{ secrets.PROVIDER_TOKEN }} >> .env | |
echo POSTGRES_DB=${{ secrets.POSTGRES_DB }} >> .env | |
echo POSTGRES_USER=${{ secrets.POSTGRES_USER }} >> .env | |
echo POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }} >> .env | |
echo POSTGRES_HOST=${{ secrets.POSTGRES_HOST }} >> .env | |
echo POSTGRES_PORT=${{ secrets.POSTGRES_PORT }} >> .env | |
echo WEB_HOST=${{ secrets.WEB_HOST }} >> .env | |
echo WEB_PORT=${{ secrets.WEB_PORT }} >> .env | |
echo WEB_PROTOKOL=${{ secrets.WEB_PROTOKOL }} >> .env | |
sudo docker compose up -d | |
sudo docker compose exec backend python manage.py migrate |