From 66f69a466369fb5f96cad370587a288ca245b459 Mon Sep 17 00:00:00 2001 From: mtouzot Date: Thu, 21 Oct 2021 00:57:37 +0200 Subject: [PATCH] [GitHub Actions] GitHub Pages deployment --- .github/workflows/gh-pages.yml | 48 ++++++++++++++++++++++++++++++++++ Makefile | 20 ++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 .github/workflows/gh-pages.yml create mode 100644 Makefile diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 0000000..9573fb2 --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,48 @@ +# Nom du workflow +name: "Build and deploy Github pages" + +# Evenements sur lesquels il doit être déclenché +on: + push: # <- Déclenché lorsque l'on pousse du code... + branches: + - master # <- ... mais seulement sur la branche "master" + +jobs: + + # Notre job + build-and-deploy: + runs-on: ubuntu-latest + + # Tâches à effectuer, comme expliquées ci-dessus + steps: + + # 1. On récupère le contenu du dépôt + - name: "Checkout" + uses: actions/checkout@v2 + with: + persist-credentials: false + + # 2. Partie spécifique à Sphinx (installation des + # dépendances et génération de la doc) + - name: "Set up Python" + uses: actions/setup-python@v1 + with: + python-version: 3.8 + + - name: "Install Python dependencies" + run: | + pip3 install setuptools + pip3 install sphinx + pip3 install sphinx-rtd-theme + + - name: "Build Sphinx Doc" + run: | + make html + + # 3. Déploiement sur les Github Pages + - name: "Deploy Github Pages" + uses: JamesIves/github-pages-deploy-action@3.7.1 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: gh-pages # <- Branche sur laquelle seront commités les fichiers + FOLDER: build/html/ # <- Dossier contenant notre documentation générée \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b97de95 --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = docs +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)