Scaffold - Release docs #14
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
# This action is used for Scaffold maintenance. It will not be used in the scaffolded project. | |
name: Scaffold - Release docs | |
on: | |
push: | |
tags: | |
- '*' | |
branches: | |
- '**release-docs**' | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: pages | |
cancel-in-progress: true | |
jobs: | |
release-docs: | |
environment: | |
name: github-pages | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: docs | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
- name: Check docs up-to-date | |
run: | | |
composer --working-dir=.utils install | |
npm run update-variables | |
git diff --quiet HEAD || { echo "Docs not up-to-date. Run 'cd .scaffold && ahoy update-docs' and commit changes."; git diff; exit 1; } | |
working-directory: '${{ github.workspace }}/.scaffold/docs' | |
- name: Install dependencies | |
run: npm install | |
working-directory: '${{ github.workspace }}/.scaffold/docs' | |
- name: Build documentation site | |
run: npm run build | |
working-directory: '${{ github.workspace }}/.scaffold/docs' | |
- name: Upload documentation site | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ".scaffold/docs/build" | |
- name: Setup SSH private key | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.DOCS_PUBLISH_SSH_PRIVATE_KEY }} | |
- name: Publish docs | |
run: | | |
cd "${GITHUB_WORKSPACE}/.scaffold/docs" | |
export DOCS_PUBLISH_SRC_DIR="${GITHUB_WORKSPACE}/.scaffold/docs/build" | |
export [email protected]:drevops/docs.git | |
export DOCS_PUBLISH_COMMIT_MESSAGE="Automatically pushed from drevops/scaffold" | |
export DOCS_PUBLISH_GIT_EMAIL="[email protected]" | |
./.utils/publish.sh |