39 lines
851 B
YAML
39 lines
851 B
YAML
name: Deploy App
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- CICD
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: kyc_runner
|
|
steps:
|
|
|
|
- name: Set up workspace directory
|
|
run: mkdir -p /opt/myapp
|
|
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
path: /opt/myapp
|
|
|
|
- name: Verify Node.js installation
|
|
run: |
|
|
if ! command -v node &> /dev/null; then
|
|
echo "Node.js not found, installing..."
|
|
sudo apt update && sudo apt install -y nodejs
|
|
fi
|
|
echo "Using Node.js version: $(node -v)"
|
|
|
|
- name: List repository files
|
|
run: ls -lah /opt/myapp
|
|
|
|
- name: Start the application with Docker Compose
|
|
run: |
|
|
cd /opt/myapp
|
|
docker-compose up --build -d
|
|
|
|
- name: Verify running containers
|
|
run: docker ps -a
|