From 06d47ddf25d923078adb33d9217c6b325b9655ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Engin=20A=C3=A7=C4=B1kg=C3=B6z?= Date: Sat, 6 Jan 2024 16:14:13 +0300 Subject: [PATCH] Create docker release --- .github/workflows/release.yaml | 22 ++++++++++++++++++++++ Dockerfile | 12 ++++++++++++ build/README.md | 0 3 files changed, 34 insertions(+) create mode 100644 Dockerfile delete mode 100644 build/README.md diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index cc81313..4daea9f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -36,3 +36,25 @@ jobs: artifacts: "release/gama-linux-amd64,release/gama-windows-amd64.exe,release/gama-macos-amd64,release/gama-macos-arm64" token: ${{ secrets.GIT_TOKEN }} draft: true + + # Docker build and push steps + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + push: true + tags: | + ${{ secrets.DOCKER_USERNAME }}/gama:${{ env.LATEST_TAG }} + ${{ secrets.DOCKER_USERNAME }}/gama:latest + build-args: | + TERM=xterm-256color diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..eda2f4d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +# This dockerfile is used by workflow to build the docker image +# It is not used to build the binary from scratch +FROM alpine:latest + +WORKDIR /app + +COPY release/gama-linux-amd64 /app/gama + +# Set environment variable for color output +ENV TERM xterm-256color + +ENTRYPOINT ["/app/gama"] \ No newline at end of file diff --git a/build/README.md b/build/README.md deleted file mode 100644 index e69de29..0000000