Files
diun/.github/workflows/docs.yml
dependabot[bot] df884b7ff4 Bump crazy-max/ghaction-github-pages from v2.1.0 to v2.1.1 (#130)
Bumps [crazy-max/ghaction-github-pages](https://github.com/crazy-max/ghaction-github-pages) from v2.1.0 to v2.1.1.
- [Release notes](https://github.com/crazy-max/ghaction-github-pages/releases)
- [Changelog](https://github.com/crazy-max/ghaction-github-pages/blob/dev/CHANGELOG.md)
- [Commits](https://github.com/crazy-max/ghaction-github-pages/compare/v2.1.0...fa6d1f62b3292dfaf504dbadd99d8ad6806bf3e1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-21 17:21:28 +00:00

70 lines
1.7 KiB
YAML

name: docs
on:
push:
branches:
- 'master'
- 'v*'
tags:
- 'v*'
paths:
- '.github/workflows/docs.yml'
- 'docs/**'
- 'CHANGELOG.md'
- 'mkdocs.yml'
pull_request:
branches:
- 'master'
- 'v*'
paths:
- '.github/workflows/docs.yml'
- 'docs/**'
- 'CHANGELOG.md'
- 'mkdocs.yml'
jobs:
publish:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Prepare
id: prepare
run: |
VERSION=edge
RELEASE=false
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/v}
fi
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
RELEASE=true
fi
echo ::set-output name=release::${RELEASE}
-
name: Build mkdocs Docker image
run: |
docker build -t mkdocs -f ./docs/Dockerfile ./
-
name: Build docs
run: |
docker run --rm -v "$(pwd):/docs" mkdocs build --strict
sudo chown -R $(id -u):$(id -g) ./site
-
name: Check GitHub Pages status
uses: crazy-max/ghaction-github-status@v1
with:
pages_threshold: major_outage
-
name: Deploy
if: success() && github.event_name != 'pull_request' && (endsWith(github.ref, github.event.repository.default_branch) || steps.prepare.outputs.release == 'true')
uses: crazy-max/ghaction-github-pages@v2.1.1
with:
target_branch: gh-pages
build_dir: site
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}