From 8135d2ecc3a4cd8b4d42989ee32c4d6b745d4d20 Mon Sep 17 00:00:00 2001 From: Jonathan Yu Date: Thu, 10 Feb 2022 17:40:41 -0800 Subject: [PATCH] chore: update Docker image publish workflow (#4847) * Use official action to log in to Docker Hub * Run using pinned ubuntu-20.04 environment --- .github/workflows/docker.yaml | 18 ++++++++++++------ ci/steps/docker-buildx-push.sh | 5 ----- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index fe3cfee5..ec1792b2 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -6,13 +6,15 @@ on: workflow_dispatch: release: - types: [released] + types: + - released jobs: docker-images: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v2 - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -20,9 +22,13 @@ jobs: - 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_PASSWORD }} + - name: Run ./ci/steps/docker-buildx-push.sh run: ./ci/steps/docker-buildx-push.sh env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + GITHUB_TOKEN: ${{ github.token }} diff --git a/ci/steps/docker-buildx-push.sh b/ci/steps/docker-buildx-push.sh index 79b20558..75688cb5 100755 --- a/ci/steps/docker-buildx-push.sh +++ b/ci/steps/docker-buildx-push.sh @@ -26,11 +26,6 @@ main() { # Download the release-packages artifact download_artifact release-packages ./release-packages - # Login to Docker - if [[ ${CI-} ]]; then - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - fi - docker buildx bake -f ci/release-image/docker-bake.hcl --push }