update
This commit is contained in:
@@ -5,7 +5,7 @@ name: Backend EC - Modal Deployment
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ['**']
|
branches: ['main']
|
||||||
workflow_dispatch: {}
|
workflow_dispatch: {}
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ name: Deploy CD Server
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ['**']
|
branches:
|
||||||
# - main
|
- main
|
||||||
# paths:
|
paths:
|
||||||
# - 'workspace/sprint_1_2/CODEBASE/deps/implementation/CD_server/**'
|
- 'workspace/sprint_1_2/CODEBASE/deps/implementation/CD_server/**'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
@@ -16,6 +16,20 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
|
|
||||||
|
- name: Prepare VM directories
|
||||||
|
uses: appleboy/ssh-action@v1.0.3
|
||||||
|
with:
|
||||||
|
host: ${{ vars.LIGHTSAIL_DEPLOY_HOST }}
|
||||||
|
username: ${{ secrets.LIGHTSAIL_USERNAME }}
|
||||||
|
key: ${{ secrets.LIGHTSAIL_SSH_KEY }}
|
||||||
|
port: ${{ vars.LIGHTSAIL_PORT }}
|
||||||
|
script: |
|
||||||
|
set -euo pipefail
|
||||||
|
DEPLOY_DIR="/opt/cd-server"
|
||||||
|
sudo mkdir -p "$DEPLOY_DIR"
|
||||||
|
sudo chown deploy:docker "$DEPLOY_DIR"
|
||||||
|
echo "[prepare] $DEPLOY_DIR ready"
|
||||||
|
|
||||||
- name: Copy CD server code to VM
|
- name: Copy CD server code to VM
|
||||||
uses: appleboy/scp-action@v0.1.7
|
uses: appleboy/scp-action@v0.1.7
|
||||||
with:
|
with:
|
||||||
@@ -37,12 +51,6 @@ jobs:
|
|||||||
script: |
|
script: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
echo "check the surrounding - the current directory"
|
|
||||||
pwd
|
|
||||||
echo "check the surrounding"
|
|
||||||
ls -la
|
|
||||||
ls -la /opt/cd-server || true
|
|
||||||
|
|
||||||
DEPLOY_DIR="/opt/cd-server"
|
DEPLOY_DIR="/opt/cd-server"
|
||||||
SERVICE_NAME="cd-server"
|
SERVICE_NAME="cd-server"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user