Skip to content

Merge pull request #53 from Xitija/main2 #70

Merge pull request #53 from Xitija/main2

Merge pull request #53 from Xitija/main2 #70

Workflow file for this run

name: QA-Server Event-Management-Service Deployment on Pratham
on:
push:
branches:
- main
jobs:
deploy_QA:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Deploy to Remote Server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST_NAME_DEV }}
username: ${{ secrets.USERNAME_DEV }}
key: ${{ secrets.SSH_KEY_DEV }}
port: ${{ secrets.PORT_DEV }}
script: |
TARGET_DIR="${{ secrets.TARGET_DIR_DEV }}"
DOCKERFILE="$TARGET_DIR/Dockerfile"
ENVIRONMENT="$TARGET_DIR/.env"
if [ -f "$DOCKERFILE" ]; then
rm "$DOCKERFILE"
fi
mkdir -p "$TARGET_DIR"
cat << EOF > "$DOCKERFILE"
${{ secrets.DOCKERFILE_CONTENT }}
EOF
if [ -f "$ENVIRONMENT" ]; then
rm "$ENVIRONMENT"
fi
mkdir -p "$TARGET_DIR"
cat << EOF > "$ENVIRONMENT"
${{ secrets.ENVIRONMENT_CONTENT }}
EOF
cd ${{ secrets.TARGET_DIR_DEV }}
./deploy.sh