Skip to content

v2.3.3

v2.3.3 #58

Workflow file for this run

name: Release Docker
on:
release:
types: [published]
workflow_dispatch:
inputs:
dry_run:
required: true
type: boolean
default: true
description: 'DryRun?'
env:
COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
jobs:
build-docker:
runs-on: ubuntu-latest
name: Build Dockers
steps:
- uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
- name: Setting env var
id: env_var
shell: bash
run: |
echo "RENDERSCRIPT_VERSION=$(node -e 'console.log(require("./package.json").version)')" >> $GITHUB_OUTPUT
echo "PLAYWRIGHT_VERSION=$(node -e 'console.log(require("./package.json").dependencies.playwright)')" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker QEMU for arm64 docker builds
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Build Image
uses: docker/[email protected]
with:
file: Dockerfile
context: .
platforms: linux/amd64 # buildx does not support multi-arch load
push: false
load: true
tags: |
algolia/renderscript:latest
algolia/renderscript:${{ steps.env_var.outputs.RENDERSCRIPT_VERSION }}
algolia/renderscript:${{ env.COMMIT_SHA }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
VERSION=${{ steps.env_var.outputs.RENDERSCRIPT_VERSION }}
PLAYWRIGHT_VERSION=${{ steps.env_var.outputs.PLAYWRIGHT_VERSION }}
- name: Test Image
run: ./scripts/test_image.sh ${{ env.COMMIT_SHA }}
# Cache should be reused from prev execution
- name: Push
if: (github.event_name == 'release') || (github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run != 'true')
uses: docker/build-push-action@v4
with:
file: Dockerfile
context: .
platforms: linux/amd64,linux/arm64/v8
push: true
tags: |
algolia/renderscript:latest
algolia/renderscript:${{ steps.env_var.outputs.RENDERSCRIPT_VERSION }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
VERSION=${{ steps.env_var.outputs.RENDERSCRIPT_VERSION }}
PLAYWRIGHT_VERSION=${{ steps.env_var.outputs.PLAYWRIGHT_VERSION }}