Skip to content

Commit

Permalink
add pages workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelloPerathoner committed Sep 8, 2024
1 parent 44f17b9 commit 8fa0e56
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 2 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish Docs

on: push

jobs:
build:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: docs/gh-pages

- name: Upload artifact
id: upload-artifact
uses: actions/upload-artifact@v4
with:
name: github-pages
path: docs/gh-pages/artifact.tar.gz
retention-days: 1
if-no-files-found: error

deploy:
needs: build

# 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 # or specific "vX.X.X" version tag for this action
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ backups
**/obsolete/
cache
cap
doc_src/jsdoc
doc_src/phpdoc
docs/build
Documents
htdocs
node_modules
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import_backup_mysql:
DOCS_DIR = $(CAPITULARIA_PRJ)/docs
DOCS_SRC_DIR = $(DOCS_DIR)/src
DOCS_BUILD_DIR = $(DOCS_DIR)/build
DOCS_DIST_DIR = $(DOCS_DIR)/gh-pages
export SPHINXBUILD=$(PYTHON) -m sphinx -c $(DOCS_DIR)
export SRCDIR=$(DOCS_SRC_DIR)
export BUILDDIR=$(DOCS_BUILD_DIR)
Expand Down Expand Up @@ -96,6 +97,10 @@ docs: phpdoc jsdoc xsltdoc

doccs: clean_docs docs

tar-docs:
mkdir -p $(DOCS_DIST_DIR)
tar -h --hard-dereference -cvf $(DOCS_DIST_DIR)/artifact.tar.gz $(DOCS_BUILD_DIR)

clean_docs:
$(RM) -r $(DOCS_BUILD_DIR)/*

Expand Down
Binary file added docs/gh-pages/artifact.tar.gz
Binary file not shown.

0 comments on commit 8fa0e56

Please sign in to comment.