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 - developbranch (can be production or stage, whatever you set) that includes changes in the- api/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_apiwith the tag- staging.
- 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 - developbranch that includes changes in the- ui/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_uiwith the tag- stagingand 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:
curl https://gist.github.com/YOUR-REPOSITORY-NAME/install.sh 
--ui-subdomain YOUR-DOMAIN --api-subdomain YOUR-DOMAINLast updated