Skip to content

[skip changelog] Split publish docs workflow #1028

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 15, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/publish-dev-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: publish-docs

on:
push:
branches:
- master
# At this day, GitHub doesn't support YAML anchors, d'oh!
paths:
- "docs/**"
- "docsgen/**"
- "cli/**"
- "rpc/**"
- ".github/workflows/publish-docs.yaml"

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install Taskfile
uses: Arduino/actions/setup-taskfile@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: "1.14"

- name: Install Go dependencies
run: |
go version
go get -u github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc

- name: Install protoc compiler
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: "3.8"
architecture: "x64"

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install Python dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r ./requirements_docs.txt

- name: Publish docs
# Determine docs version for the commit pushed and publish accordingly using Mike.
# Publishing implies creating a git commit on the gh-pages branch, we let
# ArduinoBot own these commits.
run: |
git config --global user.email "[email protected]"
git config --global user.name "ArduinoBot"
git fetch --no-tags --prune --depth=1 origin +refs/heads/gh-pages:refs/remotes/origin/gh-pages
python docs/build.py
8 changes: 0 additions & 8 deletions .github/workflows/publish-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@ name: publish-docs
on:
push:
branches:
- master
# release branches have names like 0.8.x, 0.9.x, ...
- "[0-9]+.[0-9]+.x"
# At this day, GitHub doesn't support YAML anchors, d'oh!
paths:
- "docs/**"
- "docsgen/**"
- "cli/**"
- "rpc/**"
- ".github/workflows/publish-docs.yaml"

jobs:
publish:
Expand Down