Skip to content

Commit

Permalink
Fixes staging-docs (#4070)
Browse files Browse the repository at this point in the history
* Fixes staging-docs

- var interpolation wasn't working with single quotes
- also introduce change to skip versioning on PRs which makes the build
  much faster

* Don't disable versioning on PRs
  • Loading branch information
foot authored Oct 9, 2023
1 parent 579ace8 commit 8bdfe76
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
npm i
fi
sed -i 's#url:.*$#url: "https://staging.docs.gitops.weave.works",#' docusaurus.config.js
sed -i 's#baseUrl:.*$#baseUrl: "/$GITHUB_HEAD_REF/",#' docusaurus.config.js
sed -i "s#baseUrl:.*\$#baseUrl: \"/$GITHUB_HEAD_REF/\",#" docusaurus.config.js
yarn clear
npm run build
- id: auth
Expand All @@ -64,15 +64,21 @@ jobs:
env:
GITHUB_HEAD_REF: ${{ github.head_ref }}
run: |
# Pull this out to a heredoc so we can easily interpolate variables
PAYLOAD=$(cat <<EOF
{
"state": "success",
"context": "Doc site preview",
"target_url": "https://staging.docs.gitops.weave.works/$GITHUB_HEAD_REF"
}
EOF
)
curl --request POST \
--url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.event.pull_request.head.sha }} \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
--data '{
"state": "success",
"context": "Doc site preview",
"target_url": "https://staging.docs.gitops.weave.works/$GITHUB_HEAD_REF"
}' \
--data "$PAYLOAD" \
--fail
prod-release:
Expand Down
1 change: 1 addition & 0 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ module.exports = {
id: 'default',
sidebarPath: require.resolve("./sidebars.js"),
editUrl: "https://github.com/weaveworks/weave-gitops/edit/main/website",
disableVersioning: process.env.DISABLE_VERSIONING === "true",
},
blog: {
showReadingTime: true,
Expand Down

0 comments on commit 8bdfe76

Please sign in to comment.