Skip to content

Commit

Permalink
Fix documentation build
Browse files Browse the repository at this point in the history
  • Loading branch information
Korbeil committed Mar 22, 2024
1 parent cc97be9 commit ad0b65f
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 18 deletions.
29 changes: 29 additions & 0 deletions .github/scripts/build-documentation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

# preparing fake remote
mkdir .build
git config user.name ci-bot
git config user.email ci-bot@example.org
git remote add gh-pages ./.build
cd ./.build
git init
git checkout -b gh-pages
git config receive.denyCurrentBranch ignore
cd -

# build documentation for main branch
poetry run mike deploy --push --remote gh-pages dev

# build documentation for 8.x
git checkout tags/8.2.2
poetry run mike deploy --push --remote gh-pages --update-aliases 8.2.2 latest
poetry run mike set-default --push latest

# build documentation for 9.x
git checkout 9.0 # currently a branch, will be a tag later on
poetry run mike deploy --push --remote gh-pages 9.0-BETA

# clean fake remote
cd ./.build
git reset --hard gh-pages
cd -
22 changes: 5 additions & 17 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,28 +45,16 @@ jobs:
id: pages
uses: actions/configure-pages@v4

- name: Build documentation for 8.x
run: poetry run mike deploy --push --update-aliases dev
- name: Build documentation
run: ./.github/scripts/build-documentation.sh

- name: Checkout latest 8.x tag
run: git checkout tags/8.2.2

- name: Build documentation for 8.x
run: poetry run mike deploy --push --update-aliases 8.2.2 latest

- name: Checkout latest 8.x tag
run: git checkout 9.0 # currently a branch, will be a tag later on

- name: Build documentation for 9.x
run: poetry run mike deploy --push --update-aliases 9.0-BETA

- name: Flag default version
run: mike set-default --push latest
- name: Check
run: ls ./.build

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./site
path: ./.build

deploy:
name: Deploy to GitHub Pages
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ vendor/
.phpunit.result.cache
tests/cache/
tools/phpstan/cache/
site/
site/
.build/

0 comments on commit ad0b65f

Please sign in to comment.