Skip to content

Build and Publish Browsertrix Browser Base by Release Tag #10

Build and Publish Browsertrix Browser Base by Release Tag

Build and Publish Browsertrix Browser Base by Release Tag #10

Workflow file for this run

name: Build and Publish Browsertrix Browser Base by Release Tag
on:
release:
types: [published]
jobs:
build_and_push:
name: Build x86 and ARM Images and push to Dockerhub
runs-on: ubuntu-latest
permissions:
contents: write
steps:
-
name: Check out the repo
uses: actions/checkout@v3
with:
lfs: true
-
name: Set browser version
id: set-browser-version
run: |
IFS='/-'; PARTS=($GITHUB_REF); unset IFS;
echo "BROWSER=${PARTS[2]}" >> $GITHUB_ENV
echo "BROWSER_VERSION=${PARTS[3]}" >> $GITHUB_ENV
if [[ "${PARTS[2]}" != "chrome" && "${PARTS[2]}" != "brave" ]]; then
echo "Exiting, invalid browser in tag '${PARTS[2]}', must be either 'chrome' or 'brave'"
exit 1
fi
-
name: Prepare
id: prep
run: |
DOCKER_IMAGE=webrecorder/browsertrix-browser-base
TAGS="${DOCKER_IMAGE}:${{ env.BROWSER }}-${{ env.BROWSER_VERSION }},${DOCKER_IMAGE}:${{ env.BROWSER }}"
echo ::set-output name=tags::${TAGS}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
push: true
target: ${{ env.BROWSER }}
build-args: |
BROWSER=${{ env.BROWSER }}
BROWSER_VERSION=${{ env.BROWSER_VERSION }}
tags: ${{ steps.prep.outputs.tags }}
platforms: "linux/amd64,linux/arm64"
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}