Skip to content

fix: edit compose file #44

fix: edit compose file

fix: edit compose file #44

name: Deploy
on:
workflow_run:
workflows: ["test"]
types:
- completed
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Connect to server via SSH
uses: appleboy/ssh-action@master
env:
SECRET_KEY: ${{secrets.SECRET_KEY}}
SQL_ENGINE: ${{secrets.SQL_ENGINE}}
SQL_DATABASE: ${{secrets.POSTGRES_DB}}
SQL_USER: ${{secrets.POSTGRES_USER}}
SQL_PASSWORD: ${{secrets.POSTGRES_PASSWORD}}
SQL_HOST: ${{secrets.SQL_HOST}}
SQL_PORT: ${{secrets.SQL_PORT}}
DATABASE: ${{secrets.DATABASE}}
POSTGRES_USER: ${{secrets.POSTGRES_USER}}
POSTGRES_PASSWORD: ${{secrets.POSTGRES_PASSWORD}}
POSTGRES_DB: ${{secrets.POSTGRES_DB}}
CERTBOT_EMAIL: ${{secrets.CERTBOT_EMAIL}}
CERTBOT_DOMAIN: ${{secrets.CERTBOT_DOMAIN}}
GS_CREDENTIALS: ${{secrets.GS_CREDENTIALS}}
GS_PROJECT_ID: ${{secrets.GS_PROJECT_ID}}
GS_BUCKET_NAME: ${{secrets.GS_BUCKET_NAME}}
with:
host: ${{secrets.SSH_HOST}}
username: ${{secrets.SSH_USERNAME}}
key: ${{secrets.SSH_KEY}}
port: 22
envs: SECRET_KEY,SQL_ENGINE,SQL_DATABASE,SQL_USER,SQL_PASSWORD,SQL_HOST,SQL_PORT,DATABASE,POSTGRES_USER,POSTGRES_PASSWORD,POSTGRES_DB,CERTBOT_EMAIL,CERTBOT_DOMAIN,GS_CREDENTIALS,GS_PROJECT_ID,GS_BUCKET_NAME
script: |
export SECRET_KEY=$SECRET_KEY
export SQL_ENGINE=$SQL_ENGINE
export SQL_DATABASE=$SQL_DATABASE
export SQL_USER=$SQL_USER
export SQL_PASSWORD=$SQL_PASSWORD
export SQL_HOST=$SQL_HOST
export SQL_PORT=$SQL_PORT
export DATABASE=$DATABASE
export POSTGRES_USER=$POSTGRES_USER
export POSTGRES_PASSWORD=$POSTGRES_PASSWORD
export POSTGRES_DB=$POSTGRES_DB
export CERTBOT_EMAIL=$CERTBOT_EMAIL
export CERTBOT_DOMAIN=$CERTBOT_DOMAIN
export GS_CREDENTIALS=$GS_CREDENTIALS
export GS_PROJECT_ID=$GS_PROJECT_ID
export GS_BUCKET_NAME=$GS_BUCKET_NAME
cd ~/CeTour
git pull origin main
docker compose -f docker-compose.prod.yaml down
docker compose -f docker-compose.prod.yaml up -d --build