57 lines
1.6 KiB
YAML
57 lines
1.6 KiB
YAML
# Copyright 2022 Google LLC
|
|
#
|
|
# Use of this source code is governed by a BSD-style
|
|
# license that can be found in the LICENSE file or at
|
|
# https://developers.google.com/open-source/licenses/bsd
|
|
|
|
# A workflow to update the public docs.
|
|
name: Update Docs
|
|
|
|
# Runs when a new release is published on GitHub.
|
|
#
|
|
# Pushes updated docs to GitHub Pages if triggered from a release workflow.
|
|
#
|
|
# Can also be run manually for debugging purposes.
|
|
on:
|
|
release:
|
|
types: [published]
|
|
# For manual debugging:
|
|
workflow_dispatch:
|
|
inputs:
|
|
ref:
|
|
description: "The ref to build docs from."
|
|
required: True
|
|
|
|
jobs:
|
|
publish_docs:
|
|
name: Build updated docs
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Compute ref
|
|
id: ref
|
|
# We could be building from a workflow dispatch (manual run) or from a
|
|
# release event. Subsequent steps can refer to the "ref" output of
|
|
# this job to determine the correct ref in all cases.
|
|
run: |
|
|
echo "::set-output name=ref::${{ github.event.inputs.ref || github.event.release.tag_name }}"
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
with:
|
|
ref: ${{ steps.ref.outputs.ref }}
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.8
|
|
|
|
- name: Build docs
|
|
uses: ./.github/workflows/custom-actions/build-docs
|
|
|
|
- name: Deploy to gh-pages branch
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_dir: gh-pages
|
|
full_commit_message: Generate docs for ${{ steps.ref.outputs.ref }}
|