-
Notifications
You must be signed in to change notification settings - Fork 0
28 lines (26 loc) · 819 Bytes
/
Copy pathdeploy.yml
File metadata and controls
28 lines (26 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
name: Deploy on main push
on:
workflow_dispatch:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: testing
steps:
- name: Deploy to server via SSH
uses: appleboy/ssh-action@v1.2.5
with:
host: ${{ secrets.SSH_HOST }}
port: ${{ secrets.SSH_PORT }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
echo "[$(date)] Deploying via GitHub Actions..." >> /opt/webtools/github_actions_deploy.log
sudo chown -R ${{ secrets.SSH_USER }}:${{ secrets.SSH_USER }} /opt/webtools
cd /opt/webtools
git pull origin main
make deploy
echo "[$(date)] Done!" >> /opt/webtools/github_actions_deploy.log