X Tutup
Skip to content

Commit 60a67b8

Browse files
committed
Automatically generate site docs on release
1 parent b8ecf1f commit 60a67b8

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

.github/workflows/releases.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,23 @@ jobs:
3333
formula-name: gh
3434
env:
3535
COMMITTER_TOKEN: ${{ secrets.UPLOAD_GITHUB_TOKEN }}
36-
- name: move cards
37-
if: "!contains(github.ref, '-')"
36+
- name: Checkout documentation site
37+
if: "!contains(github.ref, '-')" # skip prereleases
38+
uses: actions/checkout@v2
39+
with:
40+
repository: github/cli.github.com
41+
path: site
42+
fetch-depth: 0
43+
token: ${{secrets.SITE_GITHUB_TOKEN}}
44+
- name: Publish documentation site
45+
if: "!contains(github.ref, '-')" # skip prereleases
46+
run: make site-publish
47+
- name: Move project cards
48+
if: "!contains(github.ref, '-')" # skip prereleases
3849
env:
3950
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
4051
PENDING_COLUMN: 8189733
4152
DONE_COLUMN: 7110130
42-
shell: bash
4353
run: |
4454
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
4555
api() { bin/hub api -H 'accept: application/vnd.github.inertia-preview+json' "$@"; }

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,13 @@ site-docs: site
3434
git -C site add 'manual/gh*.md'
3535
git -C site commit -m 'update help docs'
3636
.PHONY: site-docs
37+
38+
site-publish: site-docs
39+
ifndef GITHUB_REF
40+
$(error GITHUB_REF is not set)
41+
endif
42+
sed -i.bak -E 's/(assign version = )".+"/\1"$(GITHUB_REF:refs/tags/v%=%)"/' site/index.html
43+
rm -f site/index.html.bak
44+
git -C site commit -m '$(GITHUB_REF:refs/tags/v%=%)' index.html
45+
git -C site push
46+
.PHONY: site-publish

0 commit comments

Comments
 (0)
X Tutup