1
0
Fork 0

Publish tag to Docker Hub

This tags the versions released on Docker Hub so we
can rely on those versions rather than the sha.
This commit is contained in:
James DiGioia 2021-01-10 17:08:00 -05:00 committed by GitHub
parent f7c76adfd8
commit beb0502fb4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -52,6 +52,19 @@ jobs:
restore-keys: |
${{ runner.os }}-buildx-
- name: Get publish tag
id: publish
run: |
if [[ $GITHUB_REF != refs/tags/* ]]; then
TAG="${GITHUB_REF##*/}"
else
TAG=$GITHUB_SHA
fi
echo ::set-output name=tag::${TAG}
env:
GITHUB_REF: ${{ github.ref }}
GITHUB_SHA: ${{ github.sha }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
@ -62,9 +75,9 @@ jobs:
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/archivebox:latest
${{ secrets.DOCKER_USERNAME }}/archivebox:${{ github.sha }}
${{ secrets.DOCKER_USERNAME }}/archivebox:${{ steps.publish.outputs.tag }}
archivebox/archivebox:latest
archivebox/archivebox:${{ github.sha }}
archivebox/archivebox:${{ steps.publish.outputs.tag }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
platforms: linux/amd64,linux/arm64,linux/arm/v7