chore: change environment variable #30
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: 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}} | |
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 | |
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 | |
cd ~/CeTour | |
git pull origin main | |
docker compose -f docker-compose.prod.yaml down | |
docker compose -f docker-compose.prod.yaml up -d --build |