From d275b7a6a4397a2226ed9d5fd7b9722cb89a1d54 Mon Sep 17 00:00:00 2001 From: Martin Kysel Date: Mon, 12 Aug 2024 11:13:31 -0600 Subject: [PATCH] initial attempt --- .github/workflows/build-xmtpd.yml | 42 +++++++++++++++++++++++++++++++ dev/docker/Dockerfile | 2 +- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-xmtpd.yml diff --git a/.github/workflows/build-xmtpd.yml b/.github/workflows/build-xmtpd.yml new file mode 100644 index 00000000..f77591df --- /dev/null +++ b/.github/workflows/build-xmtpd.yml @@ -0,0 +1,42 @@ +name: Build xmtpd image + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + +jobs: + push_to_registry: + name: Push Docker Image to GitHub Packages + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Log in to the container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/xmtp/xmtpd + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + id: push + with: + context: . + file: ./dev/docker/Dockerfile + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/dev/docker/Dockerfile b/dev/docker/Dockerfile index d336d374..45aef62b 100644 --- a/dev/docker/Dockerfile +++ b/dev/docker/Dockerfile @@ -1,5 +1,5 @@ # BUILD IMAGE -------------------------------------------------------- -ARG GO_VERSION=unknown +ARG GO_VERSION=1.22 FROM golang:${GO_VERSION}-alpine as builder # Get build tools and required header files