Skip to content

Instantly share code, notes, and snippets.

@zerolab
Last active October 28, 2023 15:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save zerolab/8e7fdcb83155a756c3f7d6454a7b2e39 to your computer and use it in GitHub Desktop.
Save zerolab/8e7fdcb83155a756c3f7d6454a7b2e39 to your computer and use it in GitHub Desktop.
Deploy your mkdocs to NETLIFY
name: Publish docs to Netlify
on:
push:
branches:
- master
jobs:
build:
name: Deploy docs
runs-on: ubuntu-latest
steps:
- name: Checkout master
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Cache pip
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install dependencies
run: pip install -r requirements.txt
- name: Build docs
run: mkdocs build -d build
- name: Deploy docs
uses: jsmrcaga/action-netlify-deploy@v1.1.0
with:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_DEPLOY_TO_PROD: true
NETLIFY_DEPLOY_MESSAGE: "Prod deploy v${{ github.ref }}"
@CyanBook
Copy link

CyanBook commented Dec 7, 2020

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment