v4.1.3 #64
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 | |
jobs: | |
build: | |
name: Update api docs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-node@v4 | |
- run: npm install -g npm@latest | |
continue-on-error: true | |
- uses: actions/checkout@v4 | |
with: | |
path: source | |
- uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
path: yeoman-environment-doc | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-gh-pages | |
${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}- | |
- run: npm ci | |
working-directory: source | |
- run: npm config set yeoman-environment:doc_path ../yeoman-environment-doc/${{ github.event.inputs.path }} | |
working-directory: source | |
- run: npm run doc | |
working-directory: source | |
- name: Create commit | |
working-directory: yeoman-environment-doc | |
if: always() | |
run: | | |
git add . | |
git config --local user.email "" | |
git config --local user.name "Github Actions" | |
git commit -a -m "Update api for ${{github.event.release.name}}" || true | |
- name: Create Pull Request | |
if: always() | |
id: cpr | |
uses: peter-evans/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: 'Update api for ${{github.event.release.name}}' | |
title: 'Update api for ${{github.event.release.name}}' | |
body: | | |
Update api docs | |
labels: automated pr | |
branch: gh-pages-master | |
path: yeoman-environment-doc | |
- name: Check outputs | |
run: | | |
echo "Pull Request Number - ${{ env.PULL_REQUEST_NUMBER }}" | |
echo "Pull Request Number - ${{ steps.cpr.outputs.pr_number }}" |