Files
sample-project/.gitlab-ci.yml
T
2024-04-03 13:40:40 +00:00

55 lines
1.0 KiB
YAML

stages:
- build
- predeploy
- deploy
build_backend:
stage: build
script:
- echo "Deploying code to server..."
- docker build -t my_back .notes-backend/
only:
- temasky-sample03
build_frontend:
stage: build
script:
- echo "Deploying code to server..."
- docker build -t my_front .notes-app/
only:
- temasky-sample03
build_nginx:
stage: build
script:
- echo "Deploying code to server..."
- docker build -t my_nginx .nginx/
only:
- temasky-sample03
create_network:
stage: predeploy
script:
- echo "create network..."
- docker network create app || true
only:
- temasky-sample03
run_backend_container:
stage: deploy
script:
- echo "Running container in the 'app' network..."
- docker run -d --name notes-backend --network app my_back
only:
- temasky-sample03
run_frontend_container:
stage: deploy
script:
- echo "Running container in the 'app' network..."
- docker run -d --name notes-app --network app my_front
only:
- temasky-sample03