-
Notifications
You must be signed in to change notification settings - Fork 4
38 lines (32 loc) · 985 Bytes
/
Copy pathdeploy.yml
File metadata and controls
38 lines (32 loc) · 985 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
31
32
33
34
35
36
37
38
name: Deploy to Alibaba Cloud ECS
on:
push:
branches: [main]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.ECS_SSH_KEY }}
known_hosts: unnecessary
if_key_exists: replace
- name: Add host to known_hosts
run: ssh-keyscan -H 47.107.154.165 >> ~/.ssh/known_hosts
- name: Deploy via rsync
run: |
rsync -avz --delete \
--exclude='.git' \
--exclude='.github' \
--exclude='.vscode' \
--exclude='.codex' \
--exclude='.gitignore' \
--exclude='node_modules' \
--exclude='.wrangler' \
--exclude='test-results' \
./ root@47.107.154.165:/var/www/locowiki/
- name: Reload Nginx
run: ssh root@47.107.154.165 "systemctl reload nginx"