Skip to content

Try to prevent overwriting checkout in GitHub Pages workflow (#740) #25

Try to prevent overwriting checkout in GitHub Pages workflow (#740)

Try to prevent overwriting checkout in GitHub Pages workflow (#740) #25

Workflow file for this run

name: Documentation
on:
workflow_dispatch:
push:
branches:
- v3
jobs:
apigen:
runs-on: ubuntu-22.04
name: ApiGen
steps:
- name: Checkout Project
uses: actions/checkout@v4
with:
fetch-depth: 10
- name: Run ApiGen
run: bin/apigen
- name: Upload ApiGen output artifact
# Require non local GitHub Actions Runner & the projects default branch
if: env.ACT != 'true' && ${{ format('refs/heads/{0}', github.event.repository.default_branch) == github.ref }}
uses: actions/upload-artifact@v4
with:
name: apigen
path: build/apigen
pages:
runs-on: ubuntu-22.04
name: GitHub Pages
needs: apigen
# Require non local GitHub Actions Runner & the projects default branch
if: env.ACT != 'true' && ${{ format('refs/heads/{0}', github.event.repository.default_branch) == github.ref }}
steps:
- name: Checkout GitHub Pages
uses: actions/checkout@v4
with:
fetch-depth: 10
ref: gh-pages
- name: Remove old ApiGen
run: rm -r api
- name: Download current ApiGen
uses: actions/download-artifact@v4
with:
name: apigen
path: api
- name: Download current README
uses: actions/checkout@v4
with:
path: ../source
- name: Update GitHub Pages index from README
run: cp ../source/README.md index.md
- name: Commit & Push GitHub Pages
uses: EndBug/add-and-commit@v9
with:
default_author: github_actor
message: 'Regenerated ApiGen documentation.'
cwd: gh-pages