Skip to content

Commit a9cfd4f

Browse files
committed
chore: add docs redirect on deploy
Signed-off-by: heitorlessa <lessa@amazon.co.uk>
1 parent 3f97241 commit a9cfd4f

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

.github/workflows/python_docs.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- develop
77

88
jobs:
9-
api-docs:
9+
docs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v2
@@ -16,11 +16,6 @@ jobs:
1616
uses: actions/setup-python@v1
1717
with:
1818
python-version: "3.8"
19-
- name: Capture branch and tag
20-
id: branch_name
21-
run: |
22-
echo "SOURCE_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
23-
echo "SOURCE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
2419
- name: Install dependencies
2520
run: make dev
2621
- name: Setup doc deploy
@@ -36,3 +31,11 @@ jobs:
3631
publish_dir: ./api
3732
keep_files: true
3833
destination_dir: develop/api
34+
- name: Create redirect from old docs
35+
run: |
36+
git checkout gh-pages
37+
test -f 404.html && echo "Redirect already set" && exit 0
38+
git checkout develop -- 404.html
39+
git add 404.html
40+
git commit -m "chore: set docs redirect" --no-verify
41+
git push origin gh-pages -f

0 commit comments

Comments
 (0)