-
Notifications
You must be signed in to change notification settings - Fork 1
feat: build and push docker image to ghcr workflow #6
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
Conversation
| - "v*.*.*" | ||
|
|
||
| jobs: | ||
| build-and-push: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ShehanChamudith Make a build workflow that runs before Build and Push to Docker. after the go build is complete, run Build and Push to Docker.
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| build-go: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ShehanChamudith can you modify the github actions scripts so that we use two seperate scripts for build-go and docker build (example: build.yml, docker.yml). Docker build needs be be referenced like below from the build.yml and should only be run on tag releases. But build should run on PR to main and Push to main and also on tag releases
trigger-docker-build:
needs: [build-go]
if: github.ref == 'refs/heads/main'
uses: ./.github/workflows/docker.yml
secrets: inherit
.github/workflows/build.yml
Outdated
| - name: Test | ||
| run: go test -v ./... | ||
|
|
||
| trigger-binaries: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
release-binaries
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should not build and release for cross platforms with the build.yml
we should maintain two workflows
- build.yml for building for anything like main, prs or a tag push
- release.yml - triggers only for a tag push
.github/workflows/binaries.yml
Outdated
| - name: Generate build files | ||
| uses: thatisuday/go-cross-build@v1 | ||
| with: | ||
| platforms: 'linux/amd64, darwin/amd64, windows/amd64' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall we include following platforms? https://github.com/kasvith/hackerrank-dl/blob/6b61b6d2d7a8cc8e562360111f9a7fc9cb41023d/build/build.sh#L38
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can actually copy that script here and simply run it as i did with the project
.github/workflows/binaries.yml
Outdated
| platforms: 'linux/amd64, darwin/amd64, windows/amd64' | ||
| package: '' | ||
| name: 'pulse-bridge' | ||
| compress: 'true' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets not compress
GitHub Actions Workflow to Build and Push Docker Image to GHCR
Description
This PR introduces a GitHub Actions workflow that automatically builds and pushes a Docker image to GitHub Container Registry (GHCR) on new version tag pushes (v*..). It includes:
This automation ensures consistent, versioned Docker images are published with each release.
JIRA Ticket(s)
JIRA Ticket:
Type of Change
Dependencies
Breaking Changes
Checklist