Skip to content

Commit a6b196e

Browse files
committed
fix: add a cloudfare pipelinerun for docs generation
Updated documentation links across the project to use a consistent canonical domain structure. Enabled documentation preview deployments for pull requests in the Tekton pipeline and removed the obsolete release notes generation script.
1 parent 03971d6 commit a6b196e

File tree

6 files changed

+24
-533
lines changed

6 files changed

+24
-533
lines changed

.goreleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ release:
7474
7575
The documentation for this release is available here :
7676
77-
https://release-{{ replace .Tag "." "-" }}.pipelines-as-code.pages.dev
77+
https://docs.pipelinesascode.com/{{ .Tag }}
7878
7979
homebrew_casks:
8080
- name: tektoncd-pac

.tekton/doc-cloudflare-deploy.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ metadata:
1010
event == "push" && (
1111
(target_branch == "main" && "docs/***".pathChanged()) ||
1212
git_tag != ""
13-
)
13+
) ||
14+
(event == "pull_request" && "docs/***".pathChanged())
1415
spec:
1516
params:
1617
- name: repo_url
@@ -92,11 +93,16 @@ spec:
9293
script: |
9394
#!/usr/bin/env bash
9495
set -euo pipefail
96+
pull_request_number="{{pull_request_number}}"
9597
git_tag="{{git_tag}}"
96-
if [[ -n "${git_tag}" ]]; then
98+
target_branch="{{target_branch}}"
99+
100+
if [[ -n "${pull_request_number}" ]]; then
101+
branch="pr-${pull_request_number}"
102+
elif [[ -n "${git_tag}" ]]; then
97103
branch="${git_tag}"
98104
else
99-
branch="main"
105+
branch="${target_branch}"
100106
fi
101107
cd docs/public
102108
npx --yes "wrangler@$(params.wrangler_version)" pages deploy . \

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ Once you have the `tkn-pac` CLI installed, you can set up your first repository
372372

373373
For more detailed information, please refer to the [official documentation](https://pipelinesascode.com).
374374

375-
The documentation for the development branch is available [here](https://nightly.pipelines-as-code.pages.dev/).
375+
The documentation for the development branch is available [here](https://docs.pipelinesascode.com/nightly).
376376

377377
## Contributing
378378

docs/content/docs/dev/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ PAC targets both **arm64** and **amd64** architectures. When contributing:
190190
### Staying Updated
191191

192192
- **Releases**: Follow [GitHub releases](https://github.com/tektoncd/pipelines-as-code/releases)
193-
- **Dev docs**: Check [nightly docs](https://nightly.pipelines-as-code.pages.dev/) for latest changes
193+
- **Dev docs**: Check [nightly docs](https://docs.pipelinesascode.com/nightly) for latest changes
194194

195195
## Next Steps
196196

docs/layouts/_partials/custom/footer.html

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
<div class="pac-footer-row">
22
<div class="pac-footer-left">
3-
{{ if fileExists "content/ALLVERSIONS" }}
4-
{{ $versions := os.ReadFile "content/ALLVERSIONS" }}
5-
{{ $version := "nightly"}}
6-
{{ if fileExists "content/VERSION" }}
7-
{{ $version = os.ReadFile "content/VERSION" | strings.TrimLeft "\n" | strings.TrimRight "\n" }}
8-
{{ end }}
9-
{{ $splitted := split $versions "," }}
3+
{{ if fileExists "content/ALLVERSIONS" }} {{ $versions := os.ReadFile
4+
"content/ALLVERSIONS" }} {{ $version := "nightly"}} {{ if fileExists
5+
"content/VERSION" }} {{ $version = os.ReadFile "content/VERSION" |
6+
strings.TrimLeft "\n" | strings.TrimRight "\n" }} {{ end }} {{ $splitted :=
7+
split $versions "," }}
108
<div class="pac-version-picker">
119
<svg
1210
xmlns="http://www.w3.org/2000/svg"
@@ -30,36 +28,28 @@
3028
onchange="handleVersion(this)"
3129
class="version-select"
3230
>
33-
{{ range $splitted }}
34-
{{ $trimmed := strings.TrimLeft " " . | strings.TrimRight " " }}
35-
{{ if ne $trimmed $version }}
31+
{{ range $splitted }} {{ $trimmed := strings.TrimLeft " " . |
32+
strings.TrimRight " " }} {{ if ne $trimmed $version }}
3633
<option value="{{ $trimmed }}">{{$trimmed}}</option>
3734
{{ else }}
3835
<option selected value="{{ $trimmed }}">{{$trimmed}}</option>
39-
{{ end }}
40-
{{ end }}
36+
{{ end }} {{ end }}
4137
</select>
4238
</div>
4339
<script type="text/javascript">
4440
function handleVersion(elm) {
4541
var path = window.location.pathname;
4642
if (elm.value === "nightly") {
47-
window.location =
48-
"https://nightly.pipelines-as-code.pages.dev" + path;
43+
window.location = "https://docs.pipelinesascode.com/nightly" + path;
4944
} else if (elm.value === "stable") {
50-
window.location = "https://pipelinesascode.com" + path;
45+
window.location = "https://docs.pipelinesascode.com/stable" + path;
5146
} else {
5247
window.location =
53-
"https://release-" +
54-
elm.value.replace(/\./g, "-") +
55-
".pipelines-as-code.pages.dev" +
56-
path;
48+
"https://docs.pipelinesascode.com/" + elm.value + path;
5749
}
5850
}
5951
</script>
60-
{{ end }}
61-
62-
{{ if and .context.GitInfo .context.Site.Params.editURL.enable }}
52+
{{ end }} {{ if and .context.GitInfo .context.Site.Params.editURL.enable }}
6353
<div class="pac-last-modified">
6454
{{- $date := .context.GitInfo.AuthorDate.Local.Format "2006-01-02" -}}
6555
<svg

0 commit comments

Comments
 (0)