From 1f4cff8832527bc170d4709cc41d3d99e6f006b0 Mon Sep 17 00:00:00 2001 From: Paul Albertella Date: Sun, 10 Nov 2024 15:29:15 +0000 Subject: [PATCH] Add mkdocs publish support Signed-off-by: Paul Albertella --- .github/workflows/main.yml | 57 ++++---- .github/workflows/preview.yml | 38 +++++ docs/CNAME | 1 + docs/images/elisa-horizontal-color.svg | 190 +++++++++++++++++++++++++ docs/images/elisa-logo.svg | 72 ++++++++++ docs/images/favicon.ico | Bin 0 -> 4314 bytes docs/index.md | 18 +++ docs/stylesheets/elisa.css | 47 ++++++ mkdocs.yml | 39 +++++ 9 files changed, 431 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/preview.yml create mode 100644 docs/CNAME create mode 100644 docs/images/elisa-horizontal-color.svg create mode 100644 docs/images/elisa-logo.svg create mode 100644 docs/images/favicon.ico create mode 100644 docs/index.md create mode 100644 docs/stylesheets/elisa.css create mode 100644 mkdocs.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bae05ab..32645df 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,44 +1,39 @@ -name: CI +name: main # Controls when the workflow will run on: - # Triggers the workflow on push or pull request events but only for the main branch + # Triggers the workflow on push events for the main branch push: branches: [ main ] - pull_request: - branches: [ main ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: +# Needs write permission to update the gh-pages branch that is used for GitHub Pages +permissions: + contents: write + # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on + # This workflow contains a single job called "deploy" + # Copied from https://squidfunk.github.io/mkdocs-material/publishing-your-site/ + deploy: runs-on: ubuntu-latest - - env: - STPATOOLS_VERSION: "42e07abc5510f5864aa102aa7ae1e8349911a620" - STPATOOLS_REPO: "https://gitlab.com/CodethinkLabs/stpatools.git" - - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - # Check that YAML files are well-formed - - name: YAML lint - run: yamllint -d relaxed . - - # Install specific version of ruamel.yaml required by STPAtools - - name: Install ruamel.yaml - run: pip3 install ruamel.yaml==0.16.7 - - # Install specific version of STPA tools from repo - - name: Install STPA tools - run: pip3 install "git+${{env.STPATOOLS_REPO}}@${{env.STPATOOLS_VERSION}}" - - # Validate STPA files - - name: Validate STPA files (STPA_DynMA) - run: stpa-validate STPA_DynMA/*.yml + - uses: actions/checkout@v4 + - name: Configure Git Credentials + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV + - uses: actions/cache@v4 + with: + key: mkdocs-material-${{ env.cache_id }} + path: .cache + restore-keys: | + mkdocs-material- + - run: pip install mkdocs-material mkdocs-material-extensions pymdown-extensions + - run: mkdocs gh-deploy --force diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml new file mode 100644 index 0000000..f2f47d8 --- /dev/null +++ b/.github/workflows/preview.yml @@ -0,0 +1,38 @@ +name: preview + +on: + # Triggers on pull request branch when it is marked ready for review + pull_request: + type: [ready_for_review] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Needs write permission to update the gh-pages branch that is used for GitHub Pages +permissions: + contents: write + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "preview" + # This deploys PR content to a preview sub-directory + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Configure Git Credentials + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV + - uses: actions/cache@v4 + with: + key: mkdocs-material-${{ env.cache_id }} + path: .cache + restore-keys: | + mkdocs-material- + - run: pip install mkdocs-material mkdocs-material-extensions pymdown-extensions + - run: mkdocs gh-deploy -v -d preview/ --force diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 0000000..09c6e78 --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +osep.elisa.tech diff --git a/docs/images/elisa-horizontal-color.svg b/docs/images/elisa-horizontal-color.svg new file mode 100644 index 0000000..1c058e1 --- /dev/null +++ b/docs/images/elisa-horizontal-color.svg @@ -0,0 +1,190 @@ + + diff --git a/docs/images/elisa-logo.svg b/docs/images/elisa-logo.svg new file mode 100644 index 0000000..e6048c7 --- /dev/null +++ b/docs/images/elisa-logo.svg @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + diff --git a/docs/images/favicon.ico b/docs/images/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..978b94d6ec1de25ee49aa3ecc8c33b018b362347 GIT binary patch literal 4314 zcmdtjOGs2v9LMoHV>X(aW2KTk&}<1U$jX@Yi(Ssh4 zVP#bGz>G?W5=nw=5fVKu7r9ZW)E>0z`;&WyGjm7Bblhlsx@XSg|3CMfbMJK=AOCW5 z9sTb#1sx~Lahw8BE}{#sp?l4M)1`9C8+z;ghcJw3ex0nmhJgG~@F(~(AG(&5=4@o9gH+_bkpBUQvtI+w^ z`}mGq)>;JZe350^GqZ(A+5Ny{)y- zH|RD(?;^_DuWamvzQ3PQs9e$hXiLBn+=SvaVhuds3wu26I(s`&ibS<>)x0#e35und zix8T-9m6iuNAJ1yXomK>78)CM-Q0YB+C_V`7}ue(&#?}vc8*wO`fKfSP=PjdK;PFH z2-_3IQXOWZ3hMh2<(Ldl|5*7=J7cvcdgjie3$54%y?>Nb^zAFd8+76nW+CQUn>?|u z#L{^$Mm@Bj4cLH<(EC7jby$u-taw9dC$8>Q?|`jnK@Ym|5?hdtA+Pmd=cF9a*(h