automated builds of html, reqif, and questionnaires #68
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
name: automated builds of html, reqif, and questionnaires | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
schedule: # 12AM daily | |
- cron: '0 0 * * *' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install strictdoc | |
run: | | |
python -m pip install --upgrade pip | |
git clone https://github.com/strictdoc-project/strictdoc/ | |
python -m pip install strictdoc/[development] | |
- name: Install PDF (sphinx, latex et al) dependencies | |
run: | | |
python -m pip install sphinx | |
sudo apt update -y | |
sudo apt install -y texlive latexmk texlive-latex-recommended texlive-fonts-recommended texlive-latex-extra texlive-luatex texlive-xetex | |
- name: Run strictdoc exports | |
run: | | |
mkdir -p docs/ | |
strictdoc export . --formats=html,reqif-sdoc --output-dir docs/ | |
cp -pr media docs/html/nmfta-telematics_security_requirements/ | |
cp -pr docs/reqif/* docs/html/ | |
- name: Run custom questionnaire export script | |
run: | | |
mkdir -p docs | |
python scripts/export_questionnaires.py export . --output-dir=docs/html/ | |
- name: Upload html pages | |
uses: actions/upload-artifact@v3 | |
with: | |
name: html-pages | |
path: docs/html/ | |
- name: Upload Requirements Interchange Format (ReqIF) export | |
uses: actions/upload-artifact@v3 | |
with: | |
name: reqif-export | |
path: docs/reqif/output.reqif | |
- name: Upload supplier questionnaires | |
uses: actions/upload-artifact@v3 | |
with: | |
name: questionnaires | |
path: docs/html/tsrm_questionnaires.xlsx | |
- name: (optional) Deploy to GitHub Pages (will not be executed on PRs or nightlies) | |
uses: Cecilapp/GitHub-Pages-deploy@v3 | |
if: ${{ github.event_name != 'pull_request' && github.event_name != 'schedule' }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
build_dir: docs/html | |
email: [email protected] | |
branch: gh-pages # optional | |
jekyll: no # optional |