Skip to content

Update Documentation #39

Update Documentation

Update Documentation #39

name: Update Documentation
on:
workflow_dispatch:
inputs:
version:
description: Release version (e.g., 4.21.0)
required: true
type: string
language:
description: language documentation
required: true
type: choice
default: "all"
options:
- java
- rb
- py
- dotnet
- node
- all
workflow_call:
inputs:
version:
required: true
type: string
sha:
required: true
type: string
language:
required: false
type: string
default: "all"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
determine-languages:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: set-matrix
run: |
if [ "${{ inputs.language }}" == "all" ]; then
echo 'matrix={"language":["java","rb","py","dotnet","node"]}' >> $GITHUB_OUTPUT
else
echo 'matrix={"language":["${{ inputs.language }}"]}' >> $GITHUB_OUTPUT
fi
build-docs:
needs: determine-languages
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJson(needs.determine-languages.outputs.matrix) }}
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && github.ref || inputs.sha }}
- name: Fetch gh-pages branch
run: git fetch origin gh-pages
- name: Setup git
run: |
git config --local user.email "[email protected]"
git config --local user.name "Selenium CI Bot"
- name: Setup curl for Ubuntu
run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
- name: Set up Python 3.9
if: ${{ matrix.language == 'py' }}
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install dependencies
if: ${{ matrix.language == 'py' }}
run: |
python -m pip install --upgrade pip
pip install tox
- name: Install npm dependencies
if: ${{ matrix.language == 'node' }}
run: |
npm install
npm install --prefix javascript/node/selenium-webdriver
- name: Update Documentation
run: ./go ${{ matrix.language }}:docs
- name: Documentation Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.SELENIUM_CI_TOKEN }}
author: Selenium CI Bot <[email protected]>
delete-branch: true
branch: api-docs-${{ inputs.version }}-${{ matrix.language }}
base: gh-pages
add-paths: |
docs/api/${{ matrix.language }}/**
title: Update documentation for Selenium ${{ inputs.version }} (${{ matrix.language }})
body: |
This PR updates the API documentation for **${{ matrix.language }}** language bindings to version **${{ inputs.version }}**.
- Auto-generated by [create-pull-request][1]
[1]: https://github.com/peter-evans/create-pull-request
labels: documentation
draft: false