Skip to content

Commit

Permalink
Update build-docs.yaml to update netlify.additions
Browse files Browse the repository at this point in the history
  • Loading branch information
discdiver authored Nov 17, 2023
1 parent 6d69913 commit 9a05d28
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/build-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,25 @@ jobs:
PREFECT_SOURCE: ${{ github.workspace }}/prefect_source
run: |
version="${{ env.version }}"
# If version is not 'unreleased', skip this step. We should only need to update
# the Netlify TOML when building docs for commits to Prefect's main branch.
# Update Netlify TOML when building docs
if [[ $version != "unreleased" ]]; then
exit 0
cat <<EOT > ./netlify.additions.toml
[[redirects]]
from = "/2*"
to = "/2*:splat"
status = 200
force = false

[[redirects]]
from = "/*"
to = "/$version/:splat"
status = 301

[[redirects]]
from = "/latest/"
to = "/$version/"
status = 200
EOT
fi

git checkout $branch_name
Expand Down

0 comments on commit 9a05d28

Please sign in to comment.