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:
parent
f7c76adfd8
commit
beb0502fb4
1 changed files with 16 additions and 3 deletions
17
.github/workflows/docker.yml
vendored
17
.github/workflows/docker.yml
vendored
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue