Build Docs #3
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: Build Docs | |
on: | |
workflow_dispatch: | |
env: | |
AUTODOCS_OUTPUT: "${{ github.workspace }}" | |
AUTODOCS_CACHE: "${{ github.workspace }}/storage/cache" | |
AUTODOCS_TEMPLATES: "${{ github.workspace }}/storage/templates" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache Composer packages | |
id: composer-cache | |
uses: actions/cache@v2 | |
with: | |
path: vendor | |
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-php- | |
# Install Dependencies | |
- name: Install dependencies | |
run: composer install --prefer-dist --no-progress | |
# Build Docs | |
- name: Run Autodocs | |
run: ./autodocs build | |
# Copy updated docs to main repo | |
- name: "Copy updates to main repo" | |
run: | | |
echo "Copying files..." && \ | |
cp -R "${{ env.AUTODOCS_OUTPUT }}/*.md" "${{ github.workspace }}/storage/content" && \ | |
echo "Finished copy" | |
############################################################################################ | |
# Send a Pull Request | |
############################################################################################ | |
- name: Create a PR | |
uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04 # v4.2.3 | |
id: cpr | |
with: | |
path: "${{ github.workspace }}/autodocs-demo" | |
commit-message: Update content | |
title: "[AutoDocs] Updated Docs" | |
body: "Updated Docs" | |
labels: | | |
documentation | |
automated | |
assignees: erikaheidi |