-
-
Notifications
You must be signed in to change notification settings - Fork 4
76 lines (68 loc) Β· 2.9 KB
/
documentation.yml
File metadata and controls
76 lines (68 loc) Β· 2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: documentation
# place "magic strings" used in the workflow here for convenient maintenance
env:
# this variable is used to compare against forked repositories
OUR_REPO: "ourchitecture/hello-cloud"
OUR_AUTODOC_COMMIT: "docs: auto-generated documentation"
OUR_AUTODOC_DESC: "Automatically generated documentation that requires a PR, because the main branch is protected. The @ourchitecture/hello-cloud-maintainers team will review."
OUR_AUTODOC_LABELS: "documentation"
# this variable uses a system account since there are permission issues when assigning teams
# see: https://github.com/peter-evans/create-pull-request/issues/155#issuecomment-611904487
OUR_AUTODOC_REVIEWERS: "ourchitectureio"
OUR_AUTODOC_ASSIGNEES: "ourchitectureio"
OUR_SKIP_CI: "[skip ci]"
on:
push:
branches: [main]
paths:
- "makefile"
- "mkdocs.yml"
- ".github/workflows/documentation.yml"
- "src/docs/**"
pull_request:
branches: [main]
paths:
- "makefile"
- "mkdocs.yml"
- ".github/workflows/documentation.yml"
- "src/docs/**"
jobs:
generate:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: documentation
run: |
make install-docs
sudo chown -R $(whoami) ./docs
- name: screenshots
if: ${{ github.event_name == 'pull_request' }}
run: make check-docs
# https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts#uploading-build-and-test-artifacts
- uses: actions/upload-artifact@v2
if: ${{ github.event_name == 'pull_request' }}
with:
name: screenshots
path: ./src/puppeteer/screenshots/*.png
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
# Avoid creating another PR to the forked repo when
# merging auto-docs back into forks can trigger a
# "push" build action from the fork's "main" branch.
# - push, not pull_request
# - primary repo, not forks
# examples of the issue can be seen here:
# - "Debug push": https://github.com/ourchitecture/hello-cloud/runs/4733230834?check_suite_focus=true
# - Forked "Debug push": https://github.com/ericis/hello-cloud/runs/4733253190?check_suite_focus=true
if: ${{ github.event_name == 'push' && github.repository == env.OUR_REPO }}
with:
token: ${{ secrets.GH_TOKEN_AUTO_PR }}
title: ${{ env.OUR_AUTODOC_COMMIT }}
signoff: true
commit-message: "${{ env.OUR_AUTODOC_COMMIT }} ${{ env.OUR_SKIP_CI }}"
body: ${{ env.OUR_AUTODOC_DESC }}
labels: ${{ env.OUR_AUTODOC_LABELS }}
assignees: ${{ env.OUR_AUTODOC_ASSIGNEES }}
# a PAT was generated to support this field
# see: https://github.com/peter-evans/create-pull-request/issues/155
team-reviewers: ${{ env.OUR_AUTODOC_REVIEWERS }}