|
1 | | -name: Deploy to EC2 |
| 1 | +# name: Deploy to EC2 |
2 | 2 |
|
3 | | -on: |
4 | | - push: |
5 | | - branches: |
6 | | - - main |
| 3 | +# on: |
| 4 | +# push: |
| 5 | +# branches: |
| 6 | +# - main |
7 | 7 |
|
8 | | -jobs: |
9 | | - deploy: |
| 8 | +# jobs: |
| 9 | +# deploy: |
10 | 10 |
|
11 | | - runs-on: ubuntu-latest |
| 11 | +# runs-on: ubuntu-latest |
12 | 12 |
|
13 | | - steps: |
14 | | - - name: Checkout repository |
15 | | - uses: actions/checkout@v4 |
| 13 | +# steps: |
| 14 | +# - name: Checkout repository |
| 15 | +# uses: actions/checkout@v4 |
16 | 16 |
|
17 | | - - name: Deploy to EC2 |
18 | | - uses: appleboy/ssh-action@v1.2.1 |
19 | | - with: |
20 | | - host: ${{ secrets.EC2_HOST }} |
21 | | - username: ${{ secrets.EC2_USER }} |
22 | | - key: ${{ secrets.EC2_SSH_KEY }} |
23 | | - command_timeout: "20m" |
24 | | - script: | |
25 | | - APP_DIR="/home/ubuntu/ACT" |
26 | | - REPO_URL="https://github.com/Comon-tech/ACT.git" |
27 | | - REMOTE="fork" |
28 | | - BRANCH="main" |
| 17 | +# - name: Deploy to EC2 |
| 18 | +# uses: appleboy/ssh-action@v1.2.1 |
| 19 | +# with: |
| 20 | +# host: ${{ secrets.EC2_HOST }} |
| 21 | +# username: ${{ secrets.EC2_USER }} |
| 22 | +# key: ${{ secrets.EC2_SSH_KEY }} |
| 23 | +# command_timeout: "20m" |
| 24 | +# script: | |
| 25 | +# APP_DIR="/home/ubuntu/ACT" |
| 26 | +# REPO_URL="https://github.com/Comon-tech/ACT.git" |
| 27 | +# REMOTE="fork" |
| 28 | +# BRANCH="main" |
29 | 29 |
|
30 | | - if [ ! -d "$APP_DIR" ]; then |
31 | | - echo "Directory $APP_DIR does not exist. Creating and cloning..." |
32 | | - mkdir -p "$APP_DIR" |
33 | | - cd "$APP_DIR" |
34 | | - git clone --depth 1 "$REPO_URL" . |
35 | | - git checkout "$BRANCH" |
36 | | - else |
37 | | - cd "$APP_DIR" |
38 | | - if [ ! -d ".git" ]; then |
39 | | - echo "No git repo found, Re-cloning..." |
40 | | - rm -rf * |
41 | | - git clone --depth 1 "$REPO_URL" . |
42 | | - git checkout "$BRANCH" |
43 | | - else |
44 | | - echo "Fetching and resetting..." |
45 | | - git fetch "$REMOTE" "$BRANCH" |
46 | | - git reset --hard "$REMOTE"/"$BRANCH" |
47 | | - fi |
48 | | - fi |
| 30 | +# if [ ! -d "$APP_DIR" ]; then |
| 31 | +# echo "Directory $APP_DIR does not exist. Creating and cloning..." |
| 32 | +# mkdir -p "$APP_DIR" |
| 33 | +# cd "$APP_DIR" |
| 34 | +# git clone --depth 1 "$REPO_URL" . |
| 35 | +# git checkout "$BRANCH" |
| 36 | +# else |
| 37 | +# cd "$APP_DIR" |
| 38 | +# if [ ! -d ".git" ]; then |
| 39 | +# echo "No git repo found, Re-cloning..." |
| 40 | +# rm -rf * |
| 41 | +# git clone --depth 1 "$REPO_URL" . |
| 42 | +# git checkout "$BRANCH" |
| 43 | +# else |
| 44 | +# echo "Fetching and resetting..." |
| 45 | +# git fetch "$REMOTE" "$BRANCH" |
| 46 | +# git reset --hard "$REMOTE"/"$BRANCH" |
| 47 | +# fi |
| 48 | +# fi |
49 | 49 |
|
50 | | - echo "Restarting service..." |
51 | | - sudo systemctl restart act-app.service |
52 | | - sleep 3 |
53 | | - sudo systemctl status act-app.service --no-pager |
| 50 | +# echo "Restarting service..." |
| 51 | +# sudo systemctl restart act-app.service |
| 52 | +# sleep 3 |
| 53 | +# sudo systemctl status act-app.service --no-pager |
0 commit comments