Skip to content

Commit

Permalink
Join main.yml and pr.yml into top-level.yml
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Marques <jorge.marques@analog.com>
  • Loading branch information
gastmaier committed Apr 8, 2024
1 parent 286ad8b commit a26659c
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 61 deletions.
30 changes: 0 additions & 30 deletions .github/workflows/pr.yml

This file was deleted.

57 changes: 37 additions & 20 deletions .github/workflows/main.yml → .github/workflows/top-level.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ on:
- main
paths:
- 'docs/**'
pull_request:
paths:
- 'docs/**'

jobs:
build:
name: Deploy doc
build-doc:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Set up Python
Expand All @@ -33,23 +33,44 @@ jobs:
run: |
make html
- name: Commit
- name: Store the generated doc
uses: actions/upload-artifact@v4
with:
name: html
path: docs/_build/html

deploy:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs: [build-doc]
permissions:
contents: write

steps:
- uses: actions/checkout@v4
with:
ref: 'gh-pages'
lfs: 'false'

- name: Empty gh-pages
run: |
git rm -r . --quiet
- uses: actions/download-artifact@v4
with:
name: html

- name: Patch doc build
run: |
rm -r _sources
touch .nojekyll
- name: Commit gh-pages
run: |
author=$(git log -1 --pretty=format:'%an')
email=$(git log -1 --pretty=format:'%ae')
commit=$(git rev-parse --short HEAD)
mkdir /tmp/doc
rm -r docs/_build/html/_sources
cp -r docs/_build/html/* /tmp/doc
git stash --all
git fetch origin gh-pages
git checkout -b gh-pages origin/gh-pages
git rm -r . --quiet
cp -r /tmp/doc/* .
touch .nojekyll
git lfs uninstall
git add . >> /dev/null
git config --global user.name "$author"
git config --global user.email "$email"
Expand All @@ -58,7 +79,3 @@ jobs:
- name: Push to gh-pages
run: >-
git push origin gh-pages:gh-pages
- name: Clean-up
run: >-
rm -r /tmp/doc
11 changes: 0 additions & 11 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,6 @@

# -- Custom extensions configuration ------------------------------------------

hide_collapsible_content = True
validate_links = False

pseudo_subdomains = {
'eval': 'Evaluation Boards',
'university': 'University Program',
}

# -- Options for HTML output --------------------------------------------------

html_theme = 'cosmic'
html_static_path = ['sources']
html_css_files = ["custom.css"]
html_favicon = "sources/icon.svg"

0 comments on commit a26659c

Please sign in to comment.