Skip to content

Deploy specific Chrome version #4

Deploy specific Chrome version

Deploy specific Chrome version #4

name: Deploy specific Chrome version
on:
workflow_dispatch:
inputs:
stable:
description: 'Use upstream stable build'
required: true
type: string
default: 'true'
reuse-base:
description: 'Reuse base image to build'
required: false
type: boolean
default: true
grid-version:
description: 'Grid version to build. E.g: 4.28.1. Must provide if reusing base image'
required: false
type: string
default: ''
build-date:
description: 'Build date in format YYYYMMDD. Must provide if reusing base image'
required: false
type: string
default: ''
browser-name:
description: 'Browser name to build. E.g: chrome'
required: true
type: string
default: 'chrome'
browser-version:
description: 'Browser version to build. E.g: 120'
required: true
type: string
push-image:
description: 'Push image after testing successfully'
required: true
type: boolean
default: true
env:
GRID_VERSION: ${{ github.event.inputs.grid-version }}
BROWSER_NAME: ${{ github.event.inputs.browser-name }}
BROWSER_VERSION: ${{ github.event.inputs.browser-version }}
REUSE_BASE: ${{ github.event.inputs.reuse-base || true }}
BUILD_DATE: ${{ github.event.inputs.build-date || '' }}
NAMESPACE: ${{ vars.DOCKER_NAMESPACE || 'selenium' }}
AUTHORS: ${{ vars.AUTHORS || 'SeleniumHQ' }}
PUSH_IMAGE: ${{ github.event.inputs.push-image || false }}
jobs:
deploy:
name: Deploy and Release
runs-on: ubuntu-24.04
permissions: write-all
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
large-packages: false
- name: Checkout code
uses: actions/checkout@main
with:
persist-credentials: false
fetch-depth: 0
- name: Set up containerd image store feature
uses: nick-invision/retry@master
with:
timeout_minutes: 10
max_attempts: 3
command: |
make setup_dev_env
- name: Output Docker info
run: docker info
- name: Set Selenium base version
uses: ./.github/actions/get-latest-upstream
with:
release: ${{ github.event.inputs.stable || true }}
gh_cli_token: ${{ secrets.GITHUB_TOKEN }}
- name: Sets build date
run: |
if [ -z "${BUILD_DATE}" ]; then
echo "BUILD_DATE=$(date '+%Y%m%d')" >> $GITHUB_ENV
else
echo "BUILD_DATE=${BUILD_DATE}" >> $GITHUB_ENV
fi
echo "NAME=${NAMESPACE}" >> $GITHUB_ENV
- name: Get Grid version
if: env.GRID_VERSION == ''
run: |
echo ${BASE_VERSION}
echo "GRID_VERSION=${BASE_VERSION}" >> $GITHUB_ENV
- name: Display Grid version
run: echo ${GRID_VERSION}
- name: Login Docker Hub
run: docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
env:
DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}}
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
- name: Build images
run: |
./tests/build-backward-compatible/bootstrap.sh ${GRID_VERSION} ${BROWSER_VERSION} ${BROWSER_NAME} ${REUSE_BASE}
- name: Build Hub image for testing
if: env.REUSE_BASE == 'false'
run: make hub
- name: Test images
run: |
make test_chrome
make test_chrome_standalone
- name: Push images
if: env.PUSH_IMAGE == 'true'
run: |
./tests/build-backward-compatible/bootstrap.sh ${GRID_VERSION} ${BROWSER_VERSION} ${BROWSER_NAME} ${REUSE_BASE} true true
- name: Upload changelog
if: always()
uses: actions/upload-artifact@main
with:
name: image_tags_${{ env.GRID_VERSION }}_${{ env.BROWSER_NAME }}_${{ env.BROWSER_VERSION }}
path: ./CHANGELOG/${{ env.GRID_VERSION }}/${{ env.BROWSER_NAME }}_${{ env.BROWSER_VERSION }}.md
if-no-files-found: ignore