-
Notifications
You must be signed in to change notification settings - Fork 4
29 lines (24 loc) · 873 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
name: deploy
# ----- Rename "leaflet" to a valid branch -----
on:
push:
branches: main
jobs:
deploy:
runs-on: self-hosted
steps:
# ----- Ensure all environment vars are configured -----
# DEPLOY_ (KEY, HOST, USER, PORT, ENV)
- uses: appleboy/ssh-action@master
with:
key: ${{ secrets.DEPLOY_KEY }}
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USER }}
port: ${{ secrets.DEPLOY_PORT }}
script: |
mkdir /root /root/env /root/env/${{ github.event.repository.name }}
cd ~/env/${{ github.event.repository.name }}
git clone https://github.com/${{github.repository}} .
git pull
echo '${{ secrets.DEPLOY_ENV }}' > .env
docker-compose down ; docker-compose up -d