v6.0.0-rc.5 #65
Workflow file for this run
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 api docs | |
on: | |
push: | |
branches: | |
- docs | |
release: | |
types: [published] | |
workflow_dispatch: | |
inputs: | |
path: | |
description: 'Destination path to generate' | |
required: false | |
permissions: | |
contents: read | |
jobs: | |
build: | |
permissions: | |
contents: write # for peter-evans/create-pull-request to create branch | |
pull-requests: write # for peter-evans/create-pull-request to create a PR | |
name: Update api docs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: source | |
- uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
path: yeoman-generator-doc | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- run: npm ci | |
working-directory: source | |
- name: Cleanup | |
working-directory: yeoman-generator-doc | |
run: rm *.html | |
- name: Generate doc | |
run: npm run doc | |
working-directory: source | |
env: | |
DOC_FOLDER: ${{ github.event.inputs.path }} | |
- name: Detect version | |
run: echo "::set-output name=version::$(node -e "console.log(require('./package.json').version);")" | |
working-directory: source | |
id: version | |
- name: Create commit | |
working-directory: yeoman-generator-doc | |
if: always() | |
run: | | |
git add . | |
git config --local user.email "" | |
git config --local user.name "Github Actions" | |
git diff --cached | |
git commit -a -m "Update api for ${{steps.version.outputs.version}}" || true | |
- name: Create Pull Request | |
if: always() | |
id: cpr | |
uses: peter-evans/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: 'Update api for ${{steps.version.outputs.version}}' | |
title: 'Update api for ${{steps.version.outputs.version}}' | |
body: | | |
Update api docs | |
labels: automated pr | |
branch: gh-pages-master | |
path: yeoman-generator-doc | |
- name: Check outputs | |
run: | | |
echo "Pull Request Number - ${{ env.PULL_REQUEST_NUMBER }}" | |
echo "Pull Request Number - ${{ steps.cpr.outputs.pr_number }}" |