-
-
Notifications
You must be signed in to change notification settings - Fork 616
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
added dockerfile and multiarch build job in goreleaser workflow. fixe… #1868
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,30 @@ jobs: | |
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GH_PAT}} | ||
|
||
docker: | ||
runs-on: ubuntu-latest | ||
needs: goreleaser | ||
if: ${{ secrets.DOCKER_HUB_USERNAME && secrets.DOCKER_HUB_TOKEN }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_TOKEN }} | ||
|
||
- name: Build and Push Docker image | ||
uses: docker/build-push-action@v6 | ||
platforms: linux/amd64,linux/arm64 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
tags: | | ||
go-task/task:latest | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this workflow is triggered on tag creation, it would be a good idea to tag the created image with the version tag that was created in git. That way we can have matching tags for the docker images and the git repo. We can still leave in a |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM golang:1.23.2-alpine | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would technically only be the |
||
|
||
COPY . /app | ||
|
||
WORKDIR /app | ||
|
||
RUN /app/install-task.sh -b /usr/local/bin | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My main gripe with this is that is is, at least as far as I understand, quite impossible for docker to cache any layers to speed up builds. |
||
|
||
ENTRYPOINT ["task"] |
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.
any reason we need to wait for the
goreleaser
job? I don't see any hard dependency and we could save some time by executing these jobs in parallel