Skip to content

Commit

Permalink
Publish mkdocs to github action on every update
Browse files Browse the repository at this point in the history
  • Loading branch information
b0g3r committed May 1, 2021
1 parent f68e687 commit 6fe157e
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Docs deployment
on:
push:
branches:
- cicd
pull_request:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2.3.1

- name: Set up Python 🐍
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Build docs 🏗
run: |
pip install poetry
poetry install
mkdocs build
env:
POETRY_VIRTUALENVS_CREATE: false

- name: Publish docs to Pages 🧐 [prod]
if: github.ref == 'refs/heads/master'
uses: JamesIves/github-pages-deploy-action@4.1.1
with:
branch: gh-pages
folder: site

- name: Publish to Surge 🧐 [preview]
if: github.event_name == 'pull_request'
env:
SURGE_LOGIN: dev@eventual.com
SURGE_TOKEN: 5ed7fcac90fac92170a28e638c01219b
run: |
pr_number=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
deploy_host="${pr_number}-eventual-review.surge.sh"
npx surge site $deploy_host

0 comments on commit 6fe157e

Please sign in to comment.