Deployment uses GitHub Actions to build and push Docker images to Docker Hub.
The Docker images to build are located in:
docker/frontend/prod/Dockerfile
docker/nginx/prod/Dockerfile
The Nginx configuration is in:
docker/nginx/prod/nginx.conf
Deployment is set up to be served on a VPS, which supports IPv4, IPv6, or both.
After the build completes and images are pushed to Docker Hub, the deployment step is triggered:
cd ~/apps/portfolio
git pull
docker compose -f docker-compose.prod.yml pull
docker compose -f docker-compose.prod.yml down
docker compose -f docker-compose.prod.yml up -d
The application should be cloned beforehand into the /apps/portfolio
directory.
The following secret variables must be included in the project repository to enable deployment:
DOCKERHUB_USERNAME
: Docker Hub account usernameDOCKERHUB_PASSWORD
: Docker Hub account passwordSSH_HOST
: The VPS host addressSSH_PORT
: The port for SSH access to the VPSSSH_USERNAME
: The username for SSH access to the VPSSSH_KEY
: The private SSH key for authenticating to the VPS