feat: build and push docker image to ghcr workflow#6
Conversation
| - "v*.*.*" | ||
|
|
||
| jobs: | ||
| build-and-push: |
There was a problem hiding this comment.
@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.
@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.
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.
shall we include following platforms? https://github.com/kasvith/hackerrank-dl/blob/6b61b6d2d7a8cc8e562360111f9a7fc9cb41023d/build/build.sh#L38
There was a problem hiding this comment.
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' |
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