FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
hackernoon-cli/.github/workflows/docs.yml at main · tamnd/hackernoon-cli · GitHub
tamnd
/
hackernoon-cli
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
hackernoon-cli
/
.github
/
workflows
/
docs.yml
Copy path
View runs
More file actions
More file actions
Latest commit
History
History
History
135 lines (116 loc) · 4.03 KB
Breadcrumbs
hackernoon-cli
/
.github
/
workflows
/
docs.yml
Copy path
File metadata and controls
135 lines (116 loc) · 4.03 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name
:
Docs
on
:
push
:
branches
:
[main]
paths
:
-
"
docs/**
"
-
"
.github/workflows/docs.yml
"
-
"
scripts/ensure_cloudflare_pages.py
"
workflow_dispatch
:
permissions
:
contents
:
read
pages
:
write
id-token
:
write
deployments
:
write
env
:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24
:
true
concurrency
:
group
:
docs-${{ github.ref }}
cancel-in-progress
:
true
jobs
:
build
:
runs-on
:
ubuntu-latest
steps
:
-
uses
:
actions/checkout@v6.0.2
with
:
submodules
:
true
#
Sitemap lastmod comes from the latest content commit.
fetch-depth
:
0
-
name
:
Checkout tago
uses
:
actions/checkout@v6.0.2
with
:
repository
:
tamnd/tago
path
:
.tago-src
fetch-depth
:
1
-
name
:
Setup Go
uses
:
actions/setup-go@v6.4.0
with
:
go-version-file
:
.tago-src/go.mod
cache
:
false
-
name
:
Cache tago binary
id
:
tago-bin-cache
uses
:
actions/cache@v5.0.5
with
:
path
:
/usr/local/bin/tago
key
:
tago-bin-${{ runner.os }}-${{ hashFiles('.tago-src/go.sum', '.tago-src/**/*.go') }}
-
name
:
Build tago
if
:
steps.tago-bin-cache.outputs.cache-hit != 'true'
run
:
|
cd .tago-src
go build -o /usr/local/bin/tago ./cmd/tago/
#
Two builds, one per deploy target. The theme links every page and asset
#
with absURL, so each output carries its own base path: the Pages build
#
gets the /hackernoon-cli/ sub-path, the Cloudflare build gets the domain root.
-
name
:
Build for GitHub Pages
working-directory
:
docs
run
:
tago build --base-url "https://tamnd.github.io/hackernoon-cli/" --output public-pages
#
tago absURLs theme links but passes markdown content links through, so
#
root-relative links in content need the sub-path prefixed for the Pages
#
mirror. The Cloudflare build serves from the root and needs none.
-
name
:
Rewrite content links for the Pages sub-path
run
:
|
find docs/public-pages -name '*.html' -print0 |
xargs -0 perl -pi -e 's|(href=")/(?!/)|${1}/hackernoon-cli/|g; s|(src=")/(?!/)|${1}/hackernoon-cli/|g'
-
name
:
Build for Cloudflare Pages
working-directory
:
docs
run
:
tago build --base-url "https://hackernoon-cli.tamnd.com/" --output public-cf
-
name
:
Upload Pages artifact
uses
:
actions/upload-pages-artifact@v5.0.0
with
:
path
:
docs/public-pages
-
name
:
Upload Cloudflare artifact
uses
:
actions/upload-artifact@v7.0.1
with
:
name
:
public-cf
path
:
docs/public-cf
retention-days
:
1
deploy-pages
:
runs-on
:
ubuntu-latest
needs
:
build
environment
:
name
:
github-pages
url
:
${{ steps.deployment.outputs.page_url }}
steps
:
-
name
:
Deploy to GitHub Pages
id
:
deployment
uses
:
actions/deploy-pages@v5.0.0
deploy-cloudflare
:
runs-on
:
ubuntu-latest
needs
:
build
concurrency
:
group
:
cloudflare-pages-hackernoon-cli
cancel-in-progress
:
true
steps
:
-
uses
:
actions/checkout@v6.0.2
with
:
fetch-depth
:
1
sparse-checkout
:
scripts/
-
name
:
Download Cloudflare artifact
uses
:
actions/download-artifact@v8.0.1
with
:
name
:
public-cf
path
:
public-cf
-
name
:
Ensure Cloudflare Pages config
env
:
CLOUDFLARE_API_TOKEN
:
${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID
:
${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run
:
python3 scripts/ensure_cloudflare_pages.py --project hackernoon-cli --domain hackernoon-cli.tamnd.com --zone tamnd.com
-
name
:
Deploy to Cloudflare Pages
env
:
CLOUDFLARE_API_TOKEN
:
${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID
:
${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run
:
|
npx -y wrangler@4 pages deploy public-cf \
--project-name=hackernoon-cli \
--branch=main \
--commit-dirty=true
Back
|
FazBrowse Home
|
New Git URL