Skip to content

Commit bc649f8

Browse files
committed
[ci] Add workflow to build image with specific browser version
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent a7b58a4 commit bc649f8

File tree

1 file changed

+106
-0
lines changed

1 file changed

+106
-0
lines changed

Diff for: .github/workflows/release-chrome-versions.yml

+106
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Deploy specific Chrome version
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
stable:
7+
description: 'Use upstream stable build'
8+
required: true
9+
type: string
10+
default: 'true'
11+
grid-version:
12+
description: 'Grid version to build. E.g: 4.28.1'
13+
required: false
14+
type: string
15+
browser-version:
16+
description: 'Browser version to build. E.g: 120'
17+
required: true
18+
type: string
19+
browser-name:
20+
description: 'Browser name to build. E.g: chrome'
21+
required: true
22+
type: string
23+
default: 'chrome'
24+
push-image:
25+
description: 'Push images to registry after build & test is successful'
26+
required: false
27+
type: boolean
28+
default: true
29+
build-date:
30+
description: 'Build date'
31+
required: false
32+
type: string
33+
default: ''
34+
35+
jobs:
36+
deploy:
37+
name: Deploy and Release
38+
runs-on: ubuntu-24.04
39+
permissions: write-all
40+
steps:
41+
- name: Free Disk Space (Ubuntu)
42+
uses: jlumbroso/free-disk-space@main
43+
with:
44+
tool-cache: false
45+
large-packages: false
46+
- name: Checkout code
47+
uses: actions/checkout@main
48+
with:
49+
persist-credentials: false
50+
fetch-depth: 0
51+
- name: Set up containerd image store feature
52+
uses: nick-invision/retry@master
53+
with:
54+
timeout_minutes: 10
55+
max_attempts: 3
56+
command: |
57+
make setup_dev_env
58+
- name: Output Docker info
59+
run: docker info
60+
- name: Set Selenium base version
61+
uses: ./.github/actions/get-latest-upstream
62+
with:
63+
release: ${{ github.event.inputs.stable || true }}
64+
gh_cli_token: ${{ secrets.GITHUB_TOKEN }}
65+
- name: Sets build date
66+
run: |
67+
if [ -z "${BUILD_DATE}" ]; then
68+
echo "BUILD_DATE=$(date '+%Y%m%d')" >> $GITHUB_ENV
69+
else
70+
echo "BUILD_DATE=${BUILD_DATE}" >> $GITHUB_ENV
71+
fi
72+
echo "NAME=${NAMESPACE}" >> $GITHUB_ENV
73+
cat .env | xargs -I {} echo {} >> $GITHUB_ENV
74+
env:
75+
NAMESPACE: ${{ vars.DOCKER_NAMESPACE || 'selenium' }}
76+
AUTHORS: ${{ vars.AUTHORS || 'SeleniumHQ' }}
77+
BUILD_DATE: ${{ github.event.inputs.build-date || '' }}
78+
- name: Get Grid version
79+
run: |
80+
echo ${BASE_VERSION}
81+
echo "GRID_VERSION=${BASE_VERSION}" >> $GITHUB_ENV
82+
- name: Display Grid version
83+
run: echo ${GRID_VERSION}
84+
- name: Login Docker Hub
85+
run: docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
86+
env:
87+
DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}}
88+
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
89+
- name: Build images
90+
run: |
91+
./tests/build-backward-compatible/bootstrap.sh ${GRID_VERSION} ${BROWSER_VERSION} ${BROWSER_NAME}
92+
make hub
93+
env:
94+
GRID_VERSION: ${{ github.event.inputs.grid-version || env.GRID_VERSION }}
95+
BROWSER_VERSION: ${{ github.event.inputs.browser-version }}
96+
BROWSER_NAME: ${{ github.event.inputs.browser-name }}
97+
- name: Test images
98+
run: |
99+
make test_chrome
100+
- name: Push images
101+
run: |
102+
./tests/build-backward-compatible/bootstrap.sh ${GRID_VERSION} ${BROWSER_VERSION} ${BROWSER_NAME} true
103+
env:
104+
GRID_VERSION: ${{ github.event.inputs.grid-version || env.GRID_VERSION }}
105+
BROWSER_VERSION: ${{ github.event.inputs.browser-version }}
106+
BROWSER_NAME: ${{ github.event.inputs.browser-name }}

0 commit comments

Comments
 (0)