Skip to content

Commit

Permalink
Add multiple tags to the docker image, then push
Browse files Browse the repository at this point in the history
  • Loading branch information
shizunge authored Oct 27, 2021
1 parent 9afe79b commit 71a103e
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/docker-hub-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,18 @@ jobs:
steps:
- name: checkout code
uses: actions/checkout@v2
- name: extract tag string
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: install buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: login to docker hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: build and push the latest image
- name: build and push the image
run: |
docker buildx build --push \
--tag shizunge/endlessh-go:latest \
--tag shizunge/endlessh-go:$RELEASE_VERSION \
--platform linux/amd64,linux/arm/v7,linux/arm64 .
- name: extract tag string
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: tag image
run: docker tag shizunge/endlessh-go:latest shizunge/endlessh-go:$RELEASE_VERSION
- name: push tagged image
run: docker push shizunge/endlessh-go:$RELEASE_VERSION

0 comments on commit 71a103e

Please sign in to comment.