moogoo78 is push to main branch, go deploy production server π #87
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: test CameraTrap GitHub Actions | |
run-name: ${{ github.actor }} is push to main branch, go deploy production server π | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
deploy: | |
name: Deploy to AWS EC2 | |
runs-on: ubuntu-latest | |
steps: | |
- name: executing remote ssh commands using password | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.KEY }} | |
script: | | |
cd naturedb | |
git pull origin main | |
#docker-compose -f compose.yml -f compose.prod.yml down && docker-compose -f compose.yml -f compose.prod.yml up --build -d | |
sudo docker compose -f compose.yml -f compose.prod.yml restart |