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 authored and mbats committed Nov 28, 2023
1 parent 5554253 commit 9e8a792
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
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-site/build/site/'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
3 changes: 3 additions & 0 deletions 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

0 comments on commit 9e8a792

Please sign in to comment.