Add multiple tags to the docker image, then push
This commit is contained in:
parent
1af3f66039
commit
0257de1195
1 changed files with 4 additions and 7 deletions
11
.github/workflows/docker-hub-build-push.yml
vendored
11
.github/workflows/docker-hub-build-push.yml
vendored
|
|
@ -11,6 +11,8 @@ 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
|
||||
|
|
@ -18,14 +20,9 @@ jobs:
|
|||
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue