TWTW Backend CD #131
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: TWTW Backend CD | |
on: | |
workflow_run: | |
branches: | |
- "master" | |
workflows: ["TWTW Backend CI", "TWTW Nginx Build"] | |
types: | |
- completed | |
jobs: | |
server-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
# - name: Copy docker-compose file to server | |
# uses: appleboy/scp-action@master | |
# with: | |
# host: ${{ secrets.AWS_IP }} | |
# username: ubuntu | |
# key: ${{ secrets.SSH_PRIVATE_KEY }} | |
# source: "./docker-compose.prod.yml" | |
# target: "/var/www/TWTW" | |
# - name: Deploy using docker-compose | |
# uses: appleboy/ssh-action@master | |
# with: | |
# host: ${{ secrets.AWS_IP }} | |
# username: ubuntu | |
# key: ${{ secrets.SSH_PRIVATE_KEY }} | |
# script: | | |
# if [ ! -f /var/www/TWTW/.env ]; then | |
# echo "${{ secrets.ENV_FILE }}" > /var/www/TWTW/.env | |
# fi | |
# cd /var/www/TWTW | |
# sudo docker-compose -f docker-compose.prod.yml down | |
# sudo docker-compose -f docker-compose.prod.yml pull | |
# sudo docker-compose -f docker-compose.prod.yml up -d |