Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add build workflow for pull request Docker image #32

Merged
merged 3 commits into from
Nov 25, 2024
Merged

Conversation

hlts2
Copy link
Member

@hlts2 hlts2 commented Nov 25, 2024

WHAT

  • Added build workflow for pull request docker image

WHY

Until now, builds were only done during release. To use Docker image with new features or changes for testing, we had to manually build them locally and upload them to the registry.
This process was time-consuming and made collaboration difficult for the team.

With this new CI workflow, Docker image for each pull request are automatically build and published. The image are updated whenever changes are made to the pull request, and the image tag follow pr-{number}. (Using pr-{number} instead of commit hashes helps avoid an excessive increase in tags, making management simpler and more efficient. ) This allows the team to test changes faster and more easily, improving efficiency and ensuring better quality before releases.

FYI

❯ docker run --rm civo/csi:pr-32 --version
Unable to find image 'civo/csi:pr-32' locally
pr-32: Pulling from civo/csi
da9db072f522: Already exists
646621e749e7: Pull complete
67802e5dc3f3: Pull complete
4f4fb700ef54: Pull complete
970685bff73b: Pull complete
Digest: sha256:176a9ed50251ff322b3804d16201b3ac969ffd94e6c8cbb697f4bb7adb10290f
Status: Downloaded newer image for civo/csi:pr-32
7:13AM INF CSI driver version=pr-32

@hlts2 hlts2 changed the title Add PR build workflow for pull request Docker image Add build workflow for pull request Docker image Nov 25, 2024
- name: Debug
run: |
echo "${{ steps.pr_info.outputs.PR_NUM }}"
- name: Build and push (Dockerhub)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

For now, the workflow only uploads to Docker Hub. If uploading to Google Container Registry is also acceptable, it will added separately 💡

@hlts2 hlts2 marked this pull request as ready for review November 25, 2024 07:22
@hlts2 hlts2 self-assigned this Nov 25, 2024
Copy link
Member

@rytswd rytswd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, we can proceed with this, and adjust as necessary 👍
(We did discuss internally how we may want to tag with commit sha, but that can be later)

@hlts2 hlts2 merged commit 612dbe8 into master Nov 25, 2024
6 checks passed
@hlts2 hlts2 deleted the feat/add-pr-build branch November 26, 2024 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants