Skip to content

Commit

Permalink
Add github action to build doc and push on github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeEscande committed Nov 9, 2023
1 parent 95de8e4 commit f0ec1f6
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
44 changes: 44 additions & 0 deletions .github/workflows/doc-gen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Deploy static documentation on Pages

on:
push:
branches: ["*"]
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Run Doc generation script
run: doc/generate.bash

- name: Fix permissions
run: sudo chmod -c -R +rX 'doc/docs-site/build'

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: 'doc/docs-sites/build/site/'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
5 changes: 4 additions & 1 deletion doc/generate.bash
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -x
set -e
# version : 0.1.0

SCRIPT=$(realpath "$0")
Expand All @@ -10,4 +12,5 @@ echo "Antora build"


docker build ${SCRIPTPATH} --no-cache -t syson_doc_generator:local
docker run -v $SCRIPTPATH/..:/usr/app syson_doc_generator:local

docker run -u $(id -u):$(id -g) -v $SCRIPTPATH/..:/usr/app syson_doc_generator:local

0 comments on commit f0ec1f6

Please sign in to comment.