-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (57 loc) · 1.8 KB
/
stage-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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Deploy to stage environment
on:
push:
branches:
- "stage"
jobs:
build:
uses: ./.github/workflows/build.yml
deploy:
runs-on: ubuntu-latest
environment: stage
permissions:
contents: write
needs: build
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Deploy on AWS EC2
uses: easingthemes/ssh-deploy@main
with:
SSH_PRIVATE_KEY: ${{ secrets.AWS_EC2_SSH_PRIVATE_KEY }}
ARGS: "-rlgoDzvc -i"
SOURCE: "./"
REMOTE_HOST: ${{ secrets.AWS_EC2_HOSTNAME }}
REMOTE_USER: ${{ secrets.AWS_EC2_USERNAME }}
TARGET: "~/tithe-stage/"
EXCLUDE: "/dist/, /node_modules/"
SCRIPT_BEFORE: |
ls -a
echo "================="
echo "Update"
echo "================="
sudo apt-get update -y
echo "================="
echo "Upgrade"
echo "================="
sudo apt-get upgrade -y
echo "================="
echo "Install rsync"
echo "================="
sudo apt-get install -y rsync
echo "================="
echo "Create Directory"
echo "================="
mkdir -p tithe-stage
# echo vm.swappiness=0 | sudo tee -a /etc/sysctl.conf
SCRIPT_AFTER: |
ls -a
echo "================="
echo "Change current directory to tithe-stage"
echo "================="
cd tithe-stage
echo "================="
echo "Start Stage Deploy Script"
echo "================="
sudo chmod +x ./stage-deploy.sh
./stage-deploy.sh