Skip to content

Commit

Permalink
Use a temp checkout path for automation when building docs (#2902)
Browse files Browse the repository at this point in the history
* Use a temp checkout path for automation when building docs

* Documentation update

* Check out gh-pages into its own subdirectory

* Add line to "replace preview of current PR"

---------

Co-authored-by: Olga Bulat <[email protected]>
  • Loading branch information
AetherUnbound and obulat authored Aug 29, 2023
1 parent 2d095b1 commit d34aeeb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,7 @@ jobs:
uses: actions/checkout@v3
with:
ref: gh-pages
path: gh-pages

- name: Checkout automations from repository
uses: actions/checkout@v3
Expand All @@ -824,12 +825,12 @@ jobs:
if: github.event_name == 'push'
run: |
mv /tmp/docs /tmp/gh-pages
mv _preview /tmp/gh-pages/_preview
mv gh-pages/_preview /tmp/gh-pages/_preview
- name: Replace preview of current PR
if: github.event_name == 'pull_request'
run: |
cp -r . /tmp/gh-pages
cp -r gh-pages /tmp/gh-pages
sudo rm -rf /tmp/gh-pages/_preview/${{ github.event.pull_request.number }}
mv /tmp/docs /tmp/gh-pages/_preview/${{ github.event.pull_request.number }}
Expand Down
3 changes: 3 additions & 0 deletions documentation/meta/ci_cd/jobs/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ Documentation is only emitted if all the following conditions are met.
that their changes are valid, or were skipped, implying that they have no
changes.

A comment is also published linking to the generated preview, and any new or
modified pages.

## `clean-gh-pages`

This job is executed when a PR is closed
Expand Down

0 comments on commit d34aeeb

Please sign in to comment.