Merge pull request #68 from tanhongit/deploy #40
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 Server | |
on: | |
push: | |
branches: [ deploy ] | |
jobs: | |
shellcheck: | |
name: Shellcheck | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Run ShellCheck | |
uses: ludeeus/action-shellcheck@master | |
deploy_test: | |
name: Deploy to Test Server | |
runs-on: self-hosted | |
needs: shellcheck | |
steps: | |
- name: Deploy to Remote Host | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.REMOTE_HOST }} | |
username: ${{ secrets.REMOTE_USERNAME }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
port: ${{ secrets.REMOTE_PORT }} | |
script: | | |
cd /home/tannp/telegram-bot-github-notify | |
git reset --hard HEAD | |
git clean -fd | |
git pull origin deploy | |
composer update | |
cd /home/tannp/githubworkrun/telegram-bot-github-notify | |
git reset --hard HEAD | |
git clean -fd | |
git pull origin deploy | |
composer update |