-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (38 loc) · 1.07 KB
/
Nginx-CD-prod.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
37
38
39
40
41
42
43
44
name: Nginx-CD-prod
on:
push:
branches:
- release
jobs:
deploy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: nginx.conf push
uses: appleboy/scp-action@master
with:
host: ${{ secrets.PROD_HOST }}
username: ubuntu
key: ${{ secrets.PROD_KEY }}
source: "./.deploy/nginx/conf-prod/nginx.conf"
target: "/home/ubuntu/nginx/conf"
strip_components: 4
- name: docker-compose-nginx push
uses: appleboy/scp-action@master
with:
host: ${{ secrets.PROD_HOST }}
username: ubuntu
key: ${{ secrets.PROD_KEY }}
source: "./.deploy/nginx/docker-compose.yml"
target: "/home/ubuntu/nginx"
strip_components: 3
- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.PROD_HOST }}
username: ubuntu
key: ${{ secrets.PROD_KEY }}
script: |
cd nginx
docker-compose up -d
docker image prune -f