Skip to content

Commit

Permalink
[build]: update workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
  • Loading branch information
VietND96 committed May 14, 2024
1 parent 24527c6 commit 84a8e91
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 34 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
name: Build & test
concurrency:
group: ${{ github.workflow }}

on:
workflow_call:
inputs:
release:
description: 'Test a new release process'
required: false
type: boolean
default: false
workflow_dispatch:
push:
paths-ignore:
Expand All @@ -15,6 +20,16 @@ permissions:
contents: read

jobs:
docker-test:
uses: ./.github/workflows/docker-test.yml
with:
release: ${{ inputs.release == 'true' }}

helm-chart-test:
uses: ./.github/workflows/helm-chart-test.yml
with:
release: ${{ inputs.release == 'true' }}

build-and-test:
name: Build & test Docker images with random user
runs-on: ubuntu-latest
Expand Down Expand Up @@ -51,7 +66,7 @@ jobs:
- name: Output branch name
run: echo ${BRANCH}
- name: Set Selenium base version
if: contains(toJson(github.event.commits), '[deploy]') == false
if: inputs.release != 'true'
run: |
make set_build_nightly
cat .env | xargs -I {} echo {} >> $GITHUB_ENV
Expand Down
21 changes: 17 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,27 @@ name: Deploys

on:
workflow_dispatch:
inputs:
release:
description: 'Deploy a new release'
required: false
type: boolean
default: false
push:
branches:
- trunk

jobs:
deploy:
# Only continue if the commit message has '[deploy]' in it
build-test:
if: contains(toJson(github.event.commits), '[deploy]') == true || github.event_name == 'workflow_dispatch'
uses: ./.github/workflows/build-test.yml
with:
release: ${{ github.event.inputs.release == 'true' }}

deploy:
needs:
- build-test
if: contains(toJson(github.event.commits), '[deploy]') || (github.event_name == 'workflow_dispatch' && github.event.inputs.release == 'true')
name: Deploy Docker images
runs-on: ubuntu-latest
permissions: write-all
Expand Down Expand Up @@ -118,8 +131,8 @@ jobs:
uses: softprops/action-gh-release@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ env.GRID_VERSION }}-${{ env.BUILD_DATE }}
name: ${{ env.GRID_VERSION }}-${{ env.BUILD_DATE }}
tag_name: "${{ env.GRID_VERSION }}-${{ env.BUILD_DATE }}"
name: "${{ env.GRID_VERSION }}-${{ env.BUILD_DATE }}"
body_path: "release_notes.md"
generate_release_notes: true
prerelease: ${{ env.PRERELEASE }}
Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/docker-test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
name: Test Docker Selenium
concurrency:
group: ${{ github.workflow }}

on:
workflow_call:
inputs:
release:
description: 'Test a new release process'
required: false
type: boolean
default: false
workflow_dispatch:
inputs:
request-timeout:
Expand All @@ -17,12 +22,6 @@ on:
description: 'Test parameter for different log level'
required: false
default: 'INFO'
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'

permissions:
contents: read
Expand Down Expand Up @@ -80,7 +79,7 @@ jobs:
- name: Output branch name
run: echo ${BRANCH}
- name: Set Selenium base version
if: contains(toJson(github.event.commits), '[deploy]') == false
if: inputs.release != 'true'
run: |
make set_build_nightly
cat .env | xargs -I {} echo {} >> $GITHUB_ENV
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/helm-chart-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,22 @@ on:
paths:
- 'charts/selenium-grid/Chart.yaml'
workflow_dispatch:
inputs:
release:
description: 'Deploy a new release'
required: false
type: boolean
default: false

jobs:
helm-chart-test:
uses: ./.github/workflows/helm-chart-test.yml
with:
release: ${{ github.event.inputs.release == 'true' }}

release:
needs:
- helm-chart-test
runs-on: ubuntu-latest
permissions: write-all
steps:
Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/helm-chart-test.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
name: Test Helm Charts
concurrency:
group: ${{ github.workflow }}

on:
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
workflow_call:
inputs:
release:
description: 'Test a new release process'
required: false
type: boolean
default: false
workflow_dispatch:
inputs:
request-timeout:
Expand Down Expand Up @@ -107,7 +106,7 @@ jobs:
- name: Output branch name
run: echo ${BRANCH}
- name: Set Selenium base version
if: contains(toJson(github.event.commits), '[deploy]') == false
if: inputs.release != 'true'
run: |
make set_build_nightly
cat .env | xargs -I {} echo {} >> $GITHUB_ENV
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/nightly.yaml → .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ on:
- cron: '0 1 * * *'

jobs:
docker-test:
build-test:
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
uses: ./.github/workflows/docker-test.yml

helm-chart-test:
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
uses: ./.github/workflows/helm-chart-test.yml
uses: ./.github/workflows/build-test.yml
with:
release: false

deploy:
needs:
- build-test
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
name: Nightly build
runs-on: ubuntu-latest
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
[![Build & test](https://github.com/SeleniumHQ/docker-selenium/actions/workflows/build-test.yml/badge.svg)](https://github.com/SeleniumHQ/docker-selenium/actions/workflows/build-test.yml)
[![Test Docker Selenium](https://github.com/SeleniumHQ/docker-selenium/actions/workflows/test-video.yml/badge.svg)](https://github.com/SeleniumHQ/docker-selenium/actions/workflows/test-video.yml)
[![Test Helm Charts](https://github.com/SeleniumHQ/docker-selenium/actions/workflows/helm-chart-test.yml/badge.svg)](https://github.com/SeleniumHQ/docker-selenium/actions/workflows/helm-chart-test.yml)
[![Deploys](https://github.com/SeleniumHQ/docker-selenium/actions/workflows/deploy.yml/badge.svg)](https://github.com/SeleniumHQ/docker-selenium/actions/workflows/deploy.yml)
[![Release Charts](https://github.com/SeleniumHQ/docker-selenium/actions/workflows/helm-chart-release.yml/badge.svg)](https://github.com/SeleniumHQ/docker-selenium/actions/workflows/helm-chart-release.yml)
[![Nightly](https://github.com/SeleniumHQ/docker-selenium/actions/workflows/nightly.yaml/badge.svg)](https://github.com/SeleniumHQ/docker-selenium/actions/workflows/nightly.yaml)
[![Nightly](https://github.com/SeleniumHQ/docker-selenium/actions/workflows/nightly.yml/badge.svg)](https://github.com/SeleniumHQ/docker-selenium/actions/workflows/nightly.yml)
[![Update Dev/Beta Browser Images](https://github.com/SeleniumHQ/docker-selenium/actions/workflows/update-dev-beta-browser-images.yml/badge.svg)](https://github.com/SeleniumHQ/docker-selenium/actions/workflows/update-dev-beta-browser-images.yml)

# Docker images for the Selenium Grid Server
Expand Down Expand Up @@ -55,6 +53,7 @@ Talk to us at https://www.selenium.dev/support/
* [SE_OPTS Selenium Configuration Options](#se_opts-selenium-configuration-options)
* [SE_JAVA_OPTS Java Environment Options](#se_java_opts-java-environment-options)
* [Node configuration options](#node-configuration-options)
* [Node configuration relay commands](#node-configuration-relay-commands)
* [Setting Sub Path](#setting-sub-path)
* [Setting Screen Resolution](#setting-screen-resolution)
* [Grid Url and Session Timeout](#grid-url-and-session-timeout)
Expand Down

0 comments on commit 84a8e91

Please sign in to comment.