Merge pull request #612 from mAAdhaTTah/patch-1
This commit is contained in:
commit
50ff969209
1 changed files with 24 additions and 6 deletions
28
.github/workflows/docker.yml
vendored
28
.github/workflows/docker.yml
vendored
|
@ -52,6 +52,28 @@ jobs:
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-buildx-
|
${{ runner.os }}-buildx-
|
||||||
|
|
||||||
|
- name: Prepare tags to publish
|
||||||
|
id: prep
|
||||||
|
run: |
|
||||||
|
# Always publish to latest.
|
||||||
|
TAGS="${{ secrets.DOCKER_USERNAME }}/archivebox:latest,archivebox/archivebox:latest"
|
||||||
|
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
||||||
|
VERSION="${GITHUB_REF#refs/tags/}"
|
||||||
|
MINOR=${VERSION%.*}
|
||||||
|
MAJOR=${MINOR%.*}
|
||||||
|
TAGS="$TAGS,${{ secrets.DOCKER_USERNAME }}/archivebox:$VERSION,archivebox/archivebox:$VERSION"
|
||||||
|
TAGS="$TAGS,${{ secrets.DOCKER_USERNAME }}/archivebox:$MINOR,archivebox/archivebox:$MINOR"
|
||||||
|
TAGS="$TAGS,${{ secrets.DOCKER_USERNAME }}/archivebox:$MAJOR,archivebox/archivebox:$MAJOR"
|
||||||
|
else
|
||||||
|
VERSION=$GITHUB_SHA
|
||||||
|
TAGS="$TAGS,${{ secrets.DOCKER_USERNAME }}/archivebox:$VERSION,archivebox/archivebox:$VERSION"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ::set-output name=tags::${TAGS}
|
||||||
|
env:
|
||||||
|
GITHUB_REF: ${{ github.ref }}
|
||||||
|
GITHUB_SHA: ${{ github.sha }}
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
id: docker_build
|
id: docker_build
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v2
|
||||||
|
@ -60,11 +82,7 @@ jobs:
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
builder: ${{ steps.buildx.outputs.name }}
|
builder: ${{ steps.buildx.outputs.name }}
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: ${{ steps.prep.outputs.tags }}
|
||||||
${{ secrets.DOCKER_USERNAME }}/archivebox:latest
|
|
||||||
${{ secrets.DOCKER_USERNAME }}/archivebox:${{ github.sha }}
|
|
||||||
archivebox/archivebox:latest
|
|
||||||
archivebox/archivebox:${{ github.sha }}
|
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||||
|
|
Loading…
Reference in a new issue