-
Notifications
You must be signed in to change notification settings - Fork 9
36 lines (33 loc) · 979 Bytes
/
deploy.yml
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
29
30
31
32
33
34
35
36
name: Production Server Deploy
# Trigger deployment only on push to master branch
on:
push:
branches:
- main
pull_request:
types:
- closed
branches:
- main
jobs:
deploy:
name: Deploy pushed change to prod server
runs-on: ubuntu-latest
steps:
- name: Checkout the files
uses: actions/checkout@v2
- name: Deploy branch
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HACKATHON_HOST }}
username: ${{ secrets.HACKATHON_USERNAME }}
key: ${{ secrets.HACKATHON_KEY }}
port: ${{ secrets.HACKATHON_PORT }}
script: |
echo "CI/CD: starting deploy"
cd /www/5chack.com/5chackathon.github.io
echo "CI/CD: checkout branch"
git checkout main
echo "CI/CD: pulling latest file"
git pull https://github.com/5chackathon/5chackathon.github.io.git
echo "CI/CD: finished"