-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: build and publish documentation (#200)
Automating documentation publication
- Loading branch information
Showing
17 changed files
with
305 additions
and
8 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -63,6 +63,19 @@ jobs: | |
intervalSeconds: 10 | ||
timeoutSeconds: 600 # 10m | ||
|
||
- name: Do something if build isn't launch | ||
if: steps.wait-build-service-image.outputs.conclusion == 'does not exist' | ||
run: echo job does not exist && true | ||
|
||
- name: Do something if build fail | ||
if: steps.wait-build-service-image.outputs.conclusion == 'failure' | ||
run: echo fail && false # fail if build fail | ||
|
||
- name: Do something if build timeout | ||
if: steps.wait-build-service-image.outputs.conclusion == 'timed_out' | ||
run: echo Timeout && false # fail if build time out | ||
|
||
|
||
- name: Wait for search front image container build workflow | ||
uses: tomchv/[email protected] | ||
id: wait-build-front-image | ||
|
@@ -74,17 +87,18 @@ jobs: | |
timeoutSeconds: 600 # 10m | ||
|
||
- name: Do something if build isn't launch | ||
if: steps.wait-build.outputs.conclusion == 'does not exist' | ||
if: steps.wait-build-front-image.outputs.conclusion == 'does not exist' | ||
run: echo job does not exist && true | ||
|
||
- name: Do something if build fail | ||
if: steps.wait-build.outputs.conclusion == 'failure' | ||
if: steps.wait-build-front-image.outputs.conclusion == 'failure' | ||
run: echo fail && false # fail if build fail | ||
|
||
- name: Do something if build timeout | ||
if: steps.wait-build.outputs.conclusion == 'timed_out' | ||
if: steps.wait-build-front-image.outputs.conclusion == 'timed_out' | ||
run: echo Timeout && false # fail if build time out | ||
|
||
|
||
- name: Checkout git repository | ||
uses: appleboy/ssh-action@master | ||
with: | ||
|
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,40 @@ | ||
name: 📖 Documentation | ||
|
||
on: | ||
pull_request: | ||
# on pull request we just want to build | ||
push: | ||
# on merge to main, build and publish | ||
# FIXME: remove ci-generate-docs before merging ! | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
documentation: | ||
name: Documentation | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: ensure we have a config file | ||
run: | | ||
echo "" > .envrc | ||
echo CONFIG_PATH=data/config/openfoodfacts.yml >> .envrc | ||
echo USER_IID=$(id -u) >>.envrc | ||
echo USER_GID=$(id -g) >>.envrc | ||
# generating project documentation | ||
- name: Build documentation with MkDocs | ||
run: | | ||
./scripts/generate_doc.sh | ||
- name: Deploy documentation to GitHub Pages | ||
uses: JamesIves/[email protected] | ||
# we only deploy on push to main | ||
if: | | ||
github.event_name == 'push' && github.event.ref == 'refs/heads/main' | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: "gh-pages" | ||
folder: gh_pages |
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
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
nav: | ||
- README.md | ||
- "Install": install.md | ||
- users |
Empty file.
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,2 @@ | ||
# hide this directory from Mkdocs navigation | ||
hide: true |
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,6 @@ | ||
nav: | ||
- tutorial.md | ||
- ... | how-*.md | ||
- ... | explain-*.md | ||
- ... | ref-*.md | ||
- ... |
Empty file.
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,3 @@ | ||
# Reference for Search-a-licious API | ||
|
||
**IMPORTANT:** do not edit this file, it is replaced by OpenAPI documentation (using redocly at documentation generation time). |
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,89 @@ | ||
# Reference for Search-a-licious Web Components | ||
|
||
This page documents [web Components](https://developer.mozilla.org/en-US/docs/Web/API/Web_components) | ||
provided by Search-a-licious | ||
to quickly build your interfaces. | ||
|
||
## Main components | ||
|
||
### searchalicious-bar | ||
|
||
<api-viewer src="./dist/custom-elements.json" only="searchalicious-bar"></api-viewer> | ||
|
||
### searchalicious-results | ||
<api-viewer src="./dist/custom-elements.json" only="searchalicious-results"></api-viewer> | ||
|
||
### searchalicious-pages | ||
|
||
<api-viewer src="./dist/custom-elements.json" only="searchalicious-pages"> | ||
|
||
### searchalicious-facets | ||
|
||
<api-viewer src="./dist/custom-elements.json" only="searchalicious-sort"> | ||
|
||
### searchalicious-chart | ||
|
||
<api-viewer src="./dist/custom-elements.json" only="searchalicious-chart"> | ||
|
||
### searchalicious-sort | ||
|
||
<api-viewer src="./dist/custom-elements.json" only="searchalicious-sort"> | ||
|
||
### searchalicious-sort-field | ||
|
||
<api-viewer src="./dist/custom-elements.json" only="searchalicious-field"> | ||
|
||
### searchalicious-sort-script | ||
|
||
<api-viewer src="./dist/custom-elements.json" only="searchalicious-script"> | ||
|
||
### searchalicious-button | ||
|
||
<api-viewer src="./dist/custom-elements.json" only="searchalicious-button"> | ||
|
||
### searchalicious-count | ||
|
||
<api-viewer src="./dist/custom-elements.json" only="searchalicious-count"> | ||
|
||
|
||
## Internal components | ||
|
||
### searchalicious-facet-terms | ||
|
||
<api-viewer src="./dist/custom-elements.json" only="searchalicious-facet-terms"> | ||
|
||
### searchalicious-suggestion-entry | ||
|
||
<api-viewer src="./dist/custom-elements.json" only="searchalicious-suggestion-entry"> | ||
|
||
### searchalicious-checkbox | ||
|
||
<api-viewer src="./dist/custom-elements.json" only="searchalicious-checkbox"> | ||
|
||
### searchalicious-radio | ||
|
||
<api-viewer src="./dist/custom-elements.json" only="searchalicious-radio"> | ||
|
||
### searchalicious-toggle | ||
|
||
<api-viewer src="./dist/custom-elements.json" only="searchalicious-toggle"> | ||
|
||
### searchalicious-secondary-button | ||
|
||
<api-viewer src="./dist/custom-elements.json" only="searchalicious-secondary-button"> | ||
|
||
### searchalicious-button-transparent | ||
|
||
<api-viewer src="./dist/custom-elements.json" only="searchalicious-button-transparent"> | ||
|
||
### searchalicious-icon-cross | ||
|
||
<api-viewer src="./dist/custom-elements.json" only="searchalicious-icon-cross"> | ||
|
||
### searchalicious-suggestion-entry | ||
|
||
<api-viewer src="./dist/custom-elements.json" only="searchalicious-suggestion-entry"> | ||
|
||
|
||
<!-- api-viewer element library --> | ||
<script type="module" src="https://jspm.dev/api-viewer-element"></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,40 @@ | ||
# Settings for mkdocs | ||
|
||
# Where to find documentation | ||
docs_dir: docs | ||
|
||
# Link to Github on every page | ||
repo_url: https://github.com/openfoodfacts/search-a-licious | ||
edit_uri: blob/main/docs/ | ||
# add canonical url | ||
site_url: https://openfoodfacts.github.io/search-a-licious | ||
|
||
site_name: Search-a-licious documentation | ||
site_dir: gh_pages | ||
|
||
# Note see https://hub.docker.com/r/minidocks/mkdocs | ||
# for available extensions | ||
theme: | ||
name: material | ||
|
||
markdown_extensions: | ||
- footnotes | ||
# support tables | ||
- tables | ||
# this one allow to have two space indentation counts as nested list, as in github/vscode | ||
- mdx_truly_sane_lists | ||
# this one allow to start a list without first adding a blank line, as in github/vscode | ||
- mdx_breakless_lists | ||
- pymdownx.highlight | ||
- pymdownx.superfences | ||
- toc: | ||
# add permalink after titles | ||
permalink: "#" | ||
plugins: | ||
# thanks to this plugin, the .pages files will customize navigation entries | ||
- awesome-pages | ||
- search | ||
- exclude: | ||
glob: | ||
- reports/ | ||
- "*_TODO.md" |
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,11 @@ | ||
FROM minidocks/mkdocs | ||
|
||
ARG USER_UID=1000 | ||
ARG USER_GID=1000 | ||
USER root | ||
# change user uid / gid by replacing "user" | ||
RUN deluser user && addgroup -g $USER_GID user && adduser -u $USER_UID -G user -D user | ||
# give right uid / gid to "user" | ||
RUN mkdir -p /app && chown user:user /app | ||
# install some package we need | ||
RUN pip3 install mdx_truly_sane_lists mdx-breakless-lists |
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,15 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
# Renders markdown doc in docs to html in gh_pages | ||
|
||
# get group id to use it in the docker | ||
GID=$(id -g) | ||
|
||
# create image | ||
docker build --build-arg "USER_UID=$UID" --build-arg "USER_GID=$GID" --tag 'mkdocs-builder' -f scripts/Dockerfile.mkdocs . | ||
|
||
# we use minidocks way of choosing UID / GID | ||
docker run --rm \ | ||
-e USER_ID=$UID -e GROUP_ID=$GID \ | ||
-v $(pwd):/app -w /app \ | ||
mkdocs-builder build |
Oops, something went wrong.