From e494ec2801b488fb064e8a0558bba9e6f7f883c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20M=C3=A4hl?= Date: Thu, 17 Oct 2024 19:41:33 +0200 Subject: [PATCH] added dockerfile and multiarch build job in goreleaser workflow. fixes #1801 --- .github/workflows/release.yml | 27 +++++++++++++++++++++++++++ Dockerfile | 9 +++++++++ 2 files changed, 36 insertions(+) create mode 100644 Dockerfile diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7d92660daf..766c300788 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..cdf4f289d1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM golang:1.23.2-alpine + +COPY . /app + +WORKDIR /app + +RUN /app/install-task.sh -b /usr/local/bin + +ENTRYPOINT ["task"] \ No newline at end of file