Skip to content

Commit 05fc4cf

Browse files
committed
chore: update Docker image publish workflow
* Use official action to log in to Docker Hub * Run using pinned ubuntu-20.04 environment
1 parent 25b1340 commit 05fc4cf

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

.github/workflows/docker.yaml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,33 @@ on:
66
workflow_dispatch:
77

88
release:
9-
types: [released]
9+
types:
10+
- released
11+
12+
pull_request:
13+
branches:
14+
- main
1015

1116
jobs:
1217
docker-images:
13-
runs-on: ubuntu-latest
18+
runs-on: ubuntu-20.04
1419
steps:
15-
- uses: actions/checkout@v2
20+
- name: Checkout
21+
uses: actions/checkout@v2
1622

1723
- name: Set up QEMU
1824
uses: docker/setup-qemu-action@v1
1925

2026
- name: Set up Docker Buildx
2127
uses: docker/setup-buildx-action@v1
2228

29+
- name: Login to Docker Hub
30+
uses: docker/login-action@v1
31+
with:
32+
username: ${{ secrets.DOCKER_USERNAME }}
33+
password: ${{ secrets.DOCKER_PASSWORD }}
34+
2335
- name: Run ./ci/steps/docker-buildx-push.sh
2436
run: ./ci/steps/docker-buildx-push.sh
2537
env:
26-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27-
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
28-
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
38+
GITHUB_TOKEN: ${{ github.token }}

ci/steps/docker-buildx-push.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ main() {
2626
# Download the release-packages artifact
2727
download_artifact release-packages ./release-packages
2828

29-
# Login to Docker
30-
if [[ ${CI-} ]]; then
31-
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
32-
fi
33-
3429
docker buildx bake -f ci/release-image/docker-bake.hcl --push
3530
}
3631

0 commit comments

Comments
 (0)