-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (30 loc) · 878 Bytes
/
Copy pathdeploy.yml
File metadata and controls
30 lines (30 loc) · 878 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
29
30
name: Deploy on selfhosted Docker-Server
on:
workflow_dispatch:
push:
branches: [main]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Pull repository
uses: actions/checkout@v2
- name: Scp
uses: appleboy/scp-action@master
env:
HOST: ${{ secrets.SSH_HOST }}
USERNAME: ${{ secrets.SSH_USER }}
PASSWORD: ${{ secrets.SSH_PASSWORD }}
with:
source: './'
target: ${{ github.event.repository.name }}
- name: Actions ...
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
PASSWORD: ${{ secrets.SSH_PASSWORD }}
script: |
cd ${{ github.event.repository.name }}
docker system prune -f
docker compose up -d --build