Add GitHub Actions workflow for automated Docker builds#6
Conversation
Co-authored-by: Sunwuyuan <88357633+Sunwuyuan@users.noreply.github.com>
Co-authored-by: Sunwuyuan <88357633+Sunwuyuan@users.noreply.github.com>
Co-authored-by: Sunwuyuan <88357633+Sunwuyuan@users.noreply.github.com>
Co-authored-by: Sunwuyuan <88357633+Sunwuyuan@users.noreply.github.com>
Co-authored-by: Sunwuyuan <88357633+Sunwuyuan@users.noreply.github.com>
Co-authored-by: Sunwuyuan <88357633+Sunwuyuan@users.noreply.github.com>
Co-authored-by: Sunwuyuan <88357633+Sunwuyuan@users.noreply.github.com>
Co-authored-by: Sunwuyuan <88357633+Sunwuyuan@users.noreply.github.com>
Co-authored-by: Sunwuyuan <88357633+Sunwuyuan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This pull request adds automated Docker image builds and publishing to Docker Hub using GitHub Actions. The workflow is configured to build the cloud-server Docker image and publish it as <username>/cloud-server with appropriate tags based on the trigger event.
Changes:
- Added
.github/workflows/docker.ymlworkflow that builds and publishes Docker images on pushes tomainand version tags - Updated
README.mdwith Docker Hub usage instructions and CI/CD documentation explaining the workflow configuration
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
.github/workflows/docker.yml |
New GitHub Actions workflow for automated Docker builds with Docker Hub publishing, semantic versioning support, and build-only validation for PRs |
README.md |
Added documentation for pulling pre-built images from Docker Hub and CI/CD workflow configuration details |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| And set this repository variable: | ||
| - `DOCKER_ENABLED`: Set to `true` to enable Docker Hub publishing | ||
|
|
||
| The workflow will build the Docker image on every push and only push to Docker Hub if the `DOCKER_ENABLED` variable is set to `true`. |
There was a problem hiding this comment.
The statement "The workflow will build the Docker image on every push" is misleading. According to the workflow configuration, it only runs on pushes to the main branch or version tags (e.g., v1.0.0), not on every push to every branch. Consider rephrasing to: "The workflow will build the Docker image on every push to the main branch and on version tag pushes".
| The workflow will build the Docker image on every push and only push to Docker Hub if the `DOCKER_ENABLED` variable is set to `true`. | |
| The workflow will build the Docker image on every push to the `main` branch and on version tag pushes, and will only push to Docker Hub if the `DOCKER_ENABLED` variable is set to `true`. |
|
|
||
| This repository includes a GitHub Actions workflow that automatically builds and publishes Docker images: | ||
|
|
||
| - **Trigger**: Automatically runs on push to `main` branch and on version tags (e.g., `v1.0.0`) |
There was a problem hiding this comment.
The documentation doesn't mention that the workflow also runs on pull requests targeting the main branch for build validation (without pushing to Docker Hub). Consider adding this information to the "Trigger" section: "- Pull requests to main (build-only validation without pushing to Docker Hub)".
| - **Trigger**: Automatically runs on push to `main` branch and on version tags (e.g., `v1.0.0`) | |
| - **Trigger**: Automatically runs on push to `main` branch, on pull requests targeting `main` (build-only validation without pushing to Docker Hub), and on version tags (e.g., `v1.0.0`) |
| This repository includes a GitHub Actions workflow that automatically builds and publishes Docker images: | ||
|
|
||
| - **Trigger**: Automatically runs on push to `main` branch and on version tags (e.g., `v1.0.0`) | ||
| - **Image name**: `cloud-server` |
There was a problem hiding this comment.
The image name documentation is incomplete. The actual Docker image name is <username>/cloud-server (where username is from DOCKER_USERNAME secret or github.repository_owner), not just cloud-server. This should be updated to match the actual naming convention used in the workflow (line 41 of docker.yml).
| - **Image name**: `cloud-server` | |
| - **Image name**: `<username>/cloud-server` (where `<username>` is your Docker Hub username or the GitHub repository owner) |
Automates Docker image builds and publishes to Docker Hub as
cloud-server:lateston main branch pushes, with semantic versioning support for tagged releases.Workflow Configuration
main(→latesttag), version tags (→ semver tags), PRs (build-only validation)<username>/cloud-serverlateston main branch1.0.0,1.0on version tagv1.0.0contents:read,packages:write)Required Configuration
Publishing controlled by repository variable
DOCKER_ENABLED=truewith secrets:DOCKER_USERNAME: Docker Hub usernameDOCKER_PASSWORD: Docker Hub access tokenImage name falls back to
github.repository_ownerwhenDOCKER_USERNAMEunset, allowing builds without credentials.Documentation
README updated with Docker Hub usage instructions and CI/CD documentation.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.