Skip to content

Commit

Permalink
ci: build automation for documentation
Browse files Browse the repository at this point in the history
Signed-off-by: Mike <michael.johanson@intel.com>
  • Loading branch information
rsdmike committed Nov 11, 2020
1 parent 9eb100c commit a68afc7
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/mkdocs_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# This is a basic workflow to help you get started with Actions

name: Docs-Build

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches:
- master
- ActivEdge
pull_request:
branches: [ master, ActivEdge ]
paths: docs/**

# 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
runs-on: ubuntu-latest

# 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
- uses: actions/setup-python@v2
with:
python-version: 3.8
# Runs a single command using the runners shell
- name: Run a one-line script
run: |
pip install mkdocs-material==6.1.4
mkdocs build --strict
#checkout the gh-pages branch
- uses: actions/checkout@v2
if: ${{ github.ref == 'refs/heads/master' }}
with:
path: 'to-be-published'
ref: 'gh-pages'
#copy the built site content
- name: Copy
if: ${{ github.ref == 'refs/heads/master' }}
run: cp -rlf site/* ./to-be-published/
#publish it
- name: Publish content
if: ${{ github.ref == 'refs/heads/master' }}
run: |
cd ./to-be-published
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git commit -m 'ci: ${{github.event.head_commit.message}}'
git push origin gh-pages



0 comments on commit a68afc7

Please sign in to comment.