Automatically generate site docs on release
This commit is contained in:
parent
b8ecf1fab5
commit
60a67b852a
2 changed files with 23 additions and 3 deletions
16
.github/workflows/releases.yml
vendored
16
.github/workflows/releases.yml
vendored
|
|
@ -33,13 +33,23 @@ jobs:
|
|||
formula-name: gh
|
||||
env:
|
||||
COMMITTER_TOKEN: ${{ secrets.UPLOAD_GITHUB_TOKEN }}
|
||||
- name: move cards
|
||||
if: "!contains(github.ref, '-')"
|
||||
- name: Checkout documentation site
|
||||
if: "!contains(github.ref, '-')" # skip prereleases
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: github/cli.github.com
|
||||
path: site
|
||||
fetch-depth: 0
|
||||
token: ${{secrets.SITE_GITHUB_TOKEN}}
|
||||
- name: Publish documentation site
|
||||
if: "!contains(github.ref, '-')" # skip prereleases
|
||||
run: make site-publish
|
||||
- name: Move project cards
|
||||
if: "!contains(github.ref, '-')" # skip prereleases
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
PENDING_COLUMN: 8189733
|
||||
DONE_COLUMN: 7110130
|
||||
shell: bash
|
||||
run: |
|
||||
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
|
||||
api() { bin/hub api -H 'accept: application/vnd.github.inertia-preview+json' "$@"; }
|
||||
|
|
|
|||
10
Makefile
10
Makefile
|
|
@ -34,3 +34,13 @@ site-docs: site
|
|||
git -C site add 'manual/gh*.md'
|
||||
git -C site commit -m 'update help docs'
|
||||
.PHONY: site-docs
|
||||
|
||||
site-publish: site-docs
|
||||
ifndef GITHUB_REF
|
||||
$(error GITHUB_REF is not set)
|
||||
endif
|
||||
sed -i.bak -E 's/(assign version = )".+"/\1"$(GITHUB_REF:refs/tags/v%=%)"/' site/index.html
|
||||
rm -f site/index.html.bak
|
||||
git -C site commit -m '$(GITHUB_REF:refs/tags/v%=%)' index.html
|
||||
git -C site push
|
||||
.PHONY: site-publish
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue