Skip to content

How to use mkdocs gh-deploy inside a GitHub Action ? #2369

Answered by aahnik
aahnik asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks @Andre601 for help. After little bit of testing, I made it.

name: Documentation

on:
  push:
    branches:
      - main
    paths:
      - "**.md"
      - "mkdocs.yml"
  workflow_dispatch:
  
jobs:
  docs:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - uses: actions/setup-python@v2
      - run: pip install --upgrade pip && pip install mkdocs mkdocs-gen-files
      - run: git config user.name 'github-actions[bot]' && git config user.email 'github-actions[bot]@users.noreply.github.com'
      - name: Publish docs
        run: mkdocs gh-deploy

See also: #2370 and actions/checkout#479 (comment) and fetch-depth:0

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
8 replies
@Andre601
Comment options

@aahnik
Comment options

@Andre601
Comment options

@aahnik
Comment options

@aahnik
Comment options

Comment options

You must be logged in to vote
1 reply
@gregomelo
Comment options

Answer selected by aahnik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants