🚧 Helpful error catching #12
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: | |
push: | |
branches: main | |
jobs: | |
deploy: | |
runs-on: self-hosted | |
steps: | |
- uses: appleboy/ssh-action@master | |
with: | |
key: ${{ secrets.SSH_KEY }} | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USER }} | |
port: ${{ secrets.SSH_PORT }} | |
script: | | |
mkdir ~/env ~/env/${{github.event.repository.name}} | |
cd ~/env/${{github.event.repository.name}} | |
sudo git clone https://github.com/${{github.repository}} . | |
sudo git pull | |
echo '${{ secrets.APP_ENV }}' > .env | |
sudo docker-compose down | |
sudo docker-compose up -d |