This repository builds upon this Conduit project and integrates a CI/CD pipeline.
This GitHub Actions pipeline automates the process of cloning a repository, building Docker images, and deploying an application to a remote server using Docker Compose.
The workflow is triggered under the following conditions:
Manual Trigger (workflow_dispatch): The workflow can be manually triggered from the GitHub Actions dashboard.
Push to the main Branch: When a commit is pushed to the main branch, the workflow is automatically triggered.
Workflow Call: The workflow can also be called from other workflows, requiring specific secrets:
SSH_PRIVATE_KEY: The private SSH key for accessing the remote server.REMOTE_HOST: The IP address or hostname of the remote server.REMOTE_USER: The username for the remote server.TARGET: The target directory on the remote server where files will be uploaded.The workflow consists of two main jobs (using existing github actions):
Build Job: This job builds and pushes Docker images for the frontend and backend of the application. The images are pushed to a Docker registry (GitHub Container Registry in this case).
Deploy Job: This job handles the deployment of the application to the remote server. The necessary artifacts (.env, docker-compose.yaml) are transferred, and the application is started on the remote server using Docker Compose.
.env file from the repository’s own example.env.env and docker-compose.yaml).env and docker-compose.yaml to the remote serverdocker compose down --remove-orphansdocker system prune -afdocker compose up -dSSH_PRIVATE_KEY: Private SSH key used for authenticating with the remote server.REMOTE_HOST: The IP address or domain of the remote server.REMOTE_USER: The username used to access the remote server.TARGET: The target directory on the remote server where the application will be deployed.GHCR_PAT: A GitHub Personal Access Token for authenticating with the GitHub Container Registry.Repository: https://github.com/PascalNehlsen/conduit