Update CI Release Action (#386)

* update to latest actions, use docker meta action with semver tags
This commit is contained in:
Ilya Kreymer 2023-09-18 22:43:47 -05:00 committed by GitHub
parent c4287c7ed9
commit c6cbbc1a17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,32 +10,29 @@ jobs:
steps: steps:
- -
name: Check out the repo name: Check out the repo
uses: actions/checkout@v3 uses: actions/checkout@v4
- -
name: Prepare name: Docker image metadata
id: prep id: meta
run: | uses: docker/metadata-action@v5
DOCKER_IMAGE=webrecorder/browsertrix-crawler with:
VERSION=edge images: webrecorder/browsertrix-crawler
if [[ $GITHUB_REF == refs/tags/* ]]; then tags: |
VERSION=${GITHUB_REF#refs/tags/} type=semver,pattern={{version}}
elif [[ $GITHUB_REF == refs/heads/* ]]; then
VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g')
elif [[ $GITHUB_REF == refs/pull/* ]]; then
VERSION=pr-${{ github.event.number }}
fi
TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:latest"
echo ::set-output name=tags::${TAGS}
- -
name: Set up QEMU name: Set up QEMU
uses: docker/setup-qemu-action@v1 uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- -
name: Set up Docker Buildx name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v1
- -
name: Login to DockerHub name: Login to DockerHub
uses: docker/login-action@v1 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKER_USERNAME }} username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
@ -46,7 +43,7 @@ jobs:
with: with:
context: . context: .
push: true push: true
tags: ${{ steps.prep.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
platforms: "linux/amd64,linux/arm64" platforms: "linux/amd64,linux/arm64"
- -
name: Image digest name: Image digest