Skip to content

Commit

Permalink
[DOCUMENTATION] Deploy documentation to GitHub Pages (#1355)
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastian Meyer <sebastian.meyer@opencultureconsulting.com>
  • Loading branch information
markusweigelt and sebastian-meyer authored Oct 21, 2024
1 parent 2c350b2 commit 663a89f
Showing 1 changed file with 42 additions and 6 deletions.
48 changes: 42 additions & 6 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,53 @@
name: Documentation
# Build and test documentation on pull_request and push event
# If the git reference is the master branch, additionally build the documentation artifact and deploy it to GitHub Pages

on: [ push, pull_request ]

jobs:
tests:
name: Build Test
build:
name: Build and test documentation
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Test if the documentation will render without warning
- name: Test if the documentation will render without warnings
run: |
mkdir -p Documentation-GENERATED-temp \
&& docker run --rm --pull always -v $(pwd):/project \
ghcr.io/typo3-documentation/render-guides:latest --config=Documentation --no-progress --fail-on-log
&& docker run --rm --pull always -v $(pwd):/project ghcr.io/typo3-documentation/render-guides:latest configure --project-version="dev-master" ./Documentation \
&& docker run -v $(pwd):/project ghcr.io/typo3-documentation/render-guides:latest --config=Documentation --no-progress --fail-on-log
- name: Rename root page
if: github.ref == 'refs/heads/master'
run: mv ./Documentation-GENERATED-temp/Index.html ./Documentation-GENERATED-temp/index.html

- name: Upload artifact
if: github.ref == 'refs/heads/master'
uses: actions/upload-pages-artifact@v3
with:
path: ./Documentation-GENERATED-temp/

deploy:
name: Deploy documentation to GitHub Pages

# Add a dependency to the build job
needs: build

if: github.ref == 'refs/heads/master'

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 663a89f

Please sign in to comment.