This commit is contained in:
35
.drone.yml
Normal file
35
.drone.yml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: rc-portfolio-build-deploy
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# Dockerize the Angular app
|
||||||
|
- name: dockerize
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
registry: hub.chagarlamudi.net
|
||||||
|
repo: hub.chagarlamudi.net/rc-portfolio
|
||||||
|
tags: latest
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
|
||||||
|
# Deploy the Docker container to the server
|
||||||
|
- name: deploy
|
||||||
|
image: appleboy/drone-ssh
|
||||||
|
settings:
|
||||||
|
host:
|
||||||
|
from_secret: pineapple_gateway
|
||||||
|
port:
|
||||||
|
from_secret: tornado_level
|
||||||
|
username:
|
||||||
|
from_secret: midnight_owl
|
||||||
|
password:
|
||||||
|
from_secret: dragon_scale
|
||||||
|
script:
|
||||||
|
- /usr/local/bin/docker pull hub.chagarlamudi.net/rc-portfolio:latest
|
||||||
|
- /usr/local/bin/docker stop rc-portfolio-container || true # Stop the container if it exists
|
||||||
|
- /usr/local/bin/docker rm rc-portfolio-container || true # Remove the container
|
||||||
|
- /usr/local/bin/docker run -d -p 8080:80 --name rc-portfolio-container hub.chagarlamudi.net/rc-portfolio:latest # Start the container
|
||||||
|
|
||||||
|
when:
|
||||||
|
branch:
|
||||||
|
- main # Trigger this pipeline only for the main branch
|
||||||
Reference in New Issue
Block a user