Merge pull request #10 from Dorianteffo/dev_dorian #3
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: CD | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- 'data_generator/**/*.py' | |
jobs: | |
deploy_eto_c2: | |
name: deploy_to_EC2 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Deploy server | |
uses: easingthemes/ssh-deploy@main | |
with: | |
SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }} | |
REMOTE_HOST: ${{ secrets.REMOTE_HOST }} | |
REMOTE_USER: ${{ secrets.REMOTE_USER }} | |
SOURCE: "/data_generator/" | |
TARGET: "/home/ubuntu/data_generator" | |
SCRIPT_AFTER: | | |
cd data_generator | |
echo "POSTGRES_USER=${{ secrets.POSTGRES_USER }}" > .env | |
echo "POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}" >> .env | |
echo "POSTGRES_DB=${{ secrets.POSTGRES_DB}}" >> .env | |
echo "POSTGRES_HOST=${{ secrets.POSTGRES_HOST}}" >> .env | |
echo "POSTGRES_PORT=${{ secrets.POSTGRES_PORT }}" >> .env | |
docker compose --env-file .env up --build -d run |