forked from etalab/guides.etalab.gouv.fr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to GitHub Actions and GH pages & build PDF exports (etalab#81)
* Switch to GitHub Actions and GH pages * Cache VuePress files * Upload artifact * Try to use LaTeX container * Multiple jobs * Indentation * Remove source * Source command * Set paths * Add page for PDF exports * Typo * Target blank * Add back now.json * Change org for pandoc-guides * Remove unnecessary check
- Loading branch information
1 parent
efaa4ee
commit 6f59786
Showing
5 changed files
with
156 additions
and
58 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
name: "Build and deploy" | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
publish: | ||
name: Publish to GitHub Pages | ||
needs: pdf | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/master' | ||
|
||
steps: | ||
- name: Download website build | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: website | ||
path: public/ | ||
|
||
- name: Download PDF build | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: pdf | ||
path: pdf/ | ||
|
||
- name: Move PDF files | ||
run: mv pdf public/ | ||
|
||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: public | ||
user_name: 'actions-user' | ||
user_email: '[email protected]' | ||
force_orphan: true | ||
cname: guides.etalab.gouv.fr | ||
|
||
pdf: | ||
name: Build PDF files | ||
needs: build | ||
runs-on: ubuntu-latest | ||
container: aergus/latex:latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
run: | | ||
apt update | ||
apt install -y python3-venv | ||
- name: Install pandoc-guides | ||
run: | | ||
git clone https://github.com/etalab/pandoc-guides.git /tmp/pandoc-guides | ||
cp /tmp/pandoc-guides/* . | ||
python3 -m venv venv | ||
. venv/bin/activate | ||
pip install -r requirements.txt | ||
- name: Generate PDF files | ||
run: | | ||
. venv/bin/activate | ||
python main.py algorithmes 'Expliquer les algorithmes publics' pdf/guide-algorithmes.pdf | ||
python main.py data.gouv.fr 'Publier les données sur data.gouv.fr' pdf/guide-data.gouv.fr.pdf | ||
python main.py juridique "Identifier les données à ouvrir" pdf/guide-juridique.pdf | ||
python main.py logiciels 'Ouvrir les codes sources' pdf/guide-logiciels.pdf | ||
python main.py producteurs-schemas 'Créer des schémas de données' pdf/guide-producteurs-schemas.pdf | ||
python main.py pseudonymisation "Pseudonymiser des documents grâce à l'IA" pdf/guide-pseudonymisation.pdf | ||
python main.py qualite "Préparer les données à l'ouverture et la circulation" pdf/guide-qualite.pdf | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: pdf | ||
path: pdf/ | ||
|
||
build: | ||
name: Lint and build website | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Cache Node.js modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.OS }}-node-${{ hashFiles('package-lock.json') }} | ||
|
||
- name: Cache VuePress files | ||
uses: actions/cache@v2 | ||
with: | ||
path: ./public | ||
key: ${{ runner.OS }}-vuepress | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Lint Markdown files | ||
run: npm run lint-md | ||
|
||
- name: Build VuePress website | ||
run: npm run build | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: website | ||
path: public/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<template> | ||
<div> | ||
<ul> | ||
<li v-for="item in pdfFiles" :key="item.path"> | ||
<a :href="item.path" target="_blank">📂 {{ item.name }}</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</template> | ||
<script> | ||
export default { | ||
name: 'PDFExports', | ||
computed: { | ||
pdfFiles () { | ||
return this.$site.themeConfig.pdfFiles || [] | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
title: Exports des guides en PDF | ||
sidebar: false | ||
--- | ||
|
||
# Exports des guides en PDF | ||
|
||
Tous les guides présents sur ce site web sont téléchargeables au format PDF. Ceci vous permet de les lire lorsque vous n'avez pas accès à Internet ou les imprimer en cas de besoin. | ||
|
||
<PDFExports/> | ||
|
||
::: warning Mises à jour | ||
|
||
Ces documents correspondent aux guides au moment où vous les téléchargez. Les guides étant régulièrement mis à jour, nous vous conseillons donc de vous référer en priorité à ce site web. | ||
|
||
::: |