Skip to content

Commit

Permalink
[GitHub Actions] GitHub Pages deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
mtouzot committed Oct 20, 2021
1 parent b6df963 commit 66f69a4
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 66f69a4

Please sign in to comment.