From 2f30cbf018ad148a265f58f95b64e1cd5c9b4997 Mon Sep 17 00:00:00 2001 From: Bret Fisher Date: Sat, 1 May 2021 15:58:08 -0500 Subject: [PATCH] improve comments and ghcr username --- .github/workflows/docker-build-and-push.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-build-and-push.yml b/.github/workflows/docker-build-and-push.yml index c5f9eb8..f817eb9 100644 --- a/.github/workflows/docker-build-and-push.yml +++ b/.github/workflows/docker-build-and-push.yml @@ -1,6 +1,8 @@ +--- name: Build and Push Image on: + # we want pull requests so we can build(test) but not push to image registry pull_request: branches: - 'main' @@ -37,14 +39,17 @@ jobs: tags: | type=raw,value=latest - + # we need qemu and buildx so we can build multiple platforms later name: Set up QEMU id: qemu uses: docker/setup-qemu-action@v1 - + # BuildKit (used with `docker buildx`) is the best way to build images name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v1 - - + - + # This makes image builds fast! name: Cache Docker layers uses: actions/cache@v2 with: @@ -65,9 +70,11 @@ jobs: uses: docker/login-action@v1 with: registry: ghcr.io - username: ${{ github.repository_owner }} + username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - + # this will build the images, once per platform, + # then push to both Docker Hub and GHCR name: Build and push id: docker_build uses: docker/build-push-action@v2