Update website source #706
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update website source | |
on: | |
workflow_dispatch: | |
inputs: | |
antrea-repository: | |
description: 'The Antrea repository to check-out' | |
required: false | |
default: 'antrea-io/antrea' | |
antrea-ref: | |
description: 'The Git ref to use when checking-out the Antrea repository' | |
required: false | |
default: 'main' | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Wait for exclusive access | |
uses: ben-z/gh-action-mutex@v1.0-alpha-8 | |
with: | |
repo-token: ${{ secrets.ANTREA_BOT_PAT }} | |
repository: antrea-io/website | |
branch: needs_to_commit-mutex | |
- name: Checkout Antrea | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ github.event.inputs.antrea-repository }} | |
ref: ${{ github.event.inputs.antrea-ref }} | |
path: antrea | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
ref: main | |
path: website | |
token: ${{ secrets.ANTREA_BOT_PAT }} | |
- name: Install golang | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: './website/scripts/go.mod' | |
cache-dependency-path: './website/scripts/go.sum' | |
- name: Build tools | |
working-directory: ./website/scripts | |
run: make | |
- name: Update main docs | |
if: ${{ github.event.inputs.antrea-ref == 'main' }} | |
run: | | |
./website/scripts/bin/update-main-docs -antrea-repo antrea -website-repo website | |
- name: Update release docs | |
if: ${{ github.event.inputs.antrea-ref != 'main' }} | |
env: | |
TAG: ${{ github.event.inputs.antrea-ref }} | |
run: | | |
./website/scripts/bin/freeze-version-docs -antrea-repo antrea -website-repo website -version $TAG | |
- name: Commit changes as antrea-bot | |
uses: EndBug/add-and-commit@v9 | |
with: | |
cwd: ./website | |
author_name: antrea-bot | |
author_email: antreabot@gmail.com | |
message: "Website update for ${{ github.event.inputs.antrea-ref }}" |