Skip to content

Commit

Permalink
Merge pull request intel#1032 from marquiz/devel/ci-verify-refactor
Browse files Browse the repository at this point in the history
github: refactor docs building
  • Loading branch information
klihub committed Aug 14, 2023
2 parents 639e2d7 + 207aa32 commit b4b3242
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 35 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/common-build-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build documentation
on:
workflow_call:
inputs:
publish:
default: false
required: false
type: boolean

jobs:
update-gh-pages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: Fetch gh-pages
run: git fetch --no-tags --prune --depth=1 origin refs/heads/gh-pages:refs/heads/gh-pages

- name: Install build dependencies
run: |
pip3 install --user -r docs/requirements.txt
echo "`python3 -m site --user-base`/bin" >> $GITHUB_PATH
- name: Add docs from this revision to gh-pages
run: |
git config user.name "Github"
git config user.email "no-reply@github.com"
./scripts/build/update-gh-pages.sh
- name: Publish gh-pages
if: ${{ inputs.publish }}
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git gh-pages
29 changes: 4 additions & 25 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish
name: Publish documentation

on:
push:
Expand All @@ -13,27 +13,6 @@ concurrency:

jobs:
update-gh-pages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: Fetch gh-pages
run: git fetch --no-tags --prune --depth=1 origin refs/heads/gh-pages:refs/heads/gh-pages

- name: Install build dependencies
run: |
pip3 install --user -r docs/requirements.txt
echo "`python3 -m site --user-base`/bin" >> $GITHUB_PATH
- name: Add docs from this revision to gh-pages
run: |
git config user.name "Github"
git config user.email "no-reply@github.com"
./scripts/build/update-gh-pages.sh
- name: Publish/push to gh-pages
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git gh-pages
uses: "./.github/workflows/common-build-docs.yaml"
with:
publish: true
13 changes: 3 additions & 10 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,6 @@ jobs:
- name: Codecov report
run: bash <(curl -s https://codecov.io/bash)

- name: Install gh-pages build dependencies
run: |
pip3 install --user -r docs/requirements.txt
echo "`python3 -m site --user-base`/bin" >> $GITHUB_PATH
- name: Verify update of gh-pages
run: |
git config user.name "Github"
git config user.email "no-reply@github.com"
./scripts/build/update-gh-pages.sh
build-docs:
name: Verify docs build and gh-pages update
uses: "./.github/workflows/common-build-docs.yaml"

0 comments on commit b4b3242

Please sign in to comment.