fix command #7
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: CI/CD pipeline learning | |
on: | |
push: | |
branches: | |
- withDocker | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v2 | |
- name: Setup SSH | |
uses: webfactory/ssh-agent@v0.5.0 | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Deploy to server | |
run: | | |
ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }} << EOF | |
cd app | |
git pull | |
sudo docker compose build --no-cache | |
sudo docker compose down | |
sudo docker compose up -d | |
EOF |