Deployment
GitHub Actions
This project includes two GitHub Actions workflows, located in .github/workflows/api.yml
and .github/workflows/ui.yml
, each responsible for building, pushing, and deploying Docker images for the API and UI components. In both files we have only 2 jobs: build and deployment.
API Workflow (api.yml
)
Workflow Name:
[App] Your Name
Triggers: Executes on any push to the
develop
branch (can be production or stage, whatever you set) that includes changes in theapi/
directory.Environment: Staging
Key Steps:
Checkout: Clones the repository.
Docker Hub Login: Logs into Docker Hub using stored credentials.
Docker Setup: Sets up Docker Buildx for multi-platform builds.
Build and Push: Builds and pushes the Docker image using
Dockerfile_api
with the tagstaging
.Deployment: Triggers a POST request to initiate the deployment of the newly built image on the staging server.
UI Workflow (ui.yml
)
Workflow Name:
[App] Intercode Common UI Staging
Triggers: Executes on any push to the
develop
branch that includes changes in theui/
directory.Environment: Staging
Key Steps:
Checkout: Clones the repository.
Docker Hub Login: Logs into Docker Hub using stored credentials.
Docker Setup: Sets up Docker Buildx for multi-platform builds.
Build and Push: Builds and pushes the Docker image using
Dockerfile_ui
with the tagstaging
and necessary environment variables for the UI.Deployment: Triggers a POST request to initiate the deployment of the newly built image on the staging server.
Each workflow is designed for efficient staging deployment, with automated Docker image building and pushing, and deployment triggered through HTTP requests to a configured endpoint.
For correct work you should set necessary secrets and variables in your repository settings. In settings tab find Security module click on Secrets and variables and choose actions. To secrets add next variables with your values:
DOCKER_HUB_ACCESS_TOKEN
DOCKER_HUB_USERNAME
Then on tab "Variables" add next variables with your values:
DEPLOYMENT_HOST
DEPLOYMENT_PASSWORD
DEPLOYMENT_USERNAME
You can create Docker Hub account and necessary variables following next official guide:
To run deployment type next command in your production server terminal:
Last updated