From 434fc43c4b5403b38db408621a286096806c4036 Mon Sep 17 00:00:00 2001 From: Abhinav Gupta Date: Fri, 21 Apr 2023 23:36:30 -0700 Subject: ci: Publish Docker image to ghcr.io on release (#82) Adds a workflow that builds and publishes a Docker image to ghcr.io based on the Dockerfile in the root of the repository. This will become available at https://github.com/uber-go/sally/pkgs/container/sally. Users will be able to import it by using `ghcr.io/uber-go/sally:$tag` with `docker pull` or in the `FROM` clause of their own Docker file. As a test for this, I published it manually to my own fork. The image is at https://github.com/abhinav/sally/pkgs/container/sally. With that, I ran the following Dockerfile: FROM ghcr.io/abhinav/sally:master COPY sally.yaml / And it worked as expected. --- .github/workflows/go.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to '.github/workflows/go.yml') diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 7411a85..7561b25 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -31,3 +31,17 @@ jobs: - name: Upload coverage to codecov.io uses: codecov/codecov-action@v1 + + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build image + uses: docker/build-push-action@v4 + with: + context: . -- cgit v1.2.3