docs: fix version redirect

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi 2021-05-27 14:48:54 -07:00
parent 65da2f1c59
commit cb23fa872a

View File

@ -68,13 +68,22 @@ jobs:
# landing alway on latest tag # landing alway on latest tag
# use S3 Rediret objet # use S3 Rediret objet
# upload to /docs/index.html # upload to /docs/index.html
- run: touch index.html - name: Create index.html
- name: Redirect Latest tag on landing run: |
# FIXME cat <<EOF > index.html
# if: ${{ steps.vars.outputs.tag != 'devel' }} <!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="0; url=/${{steps.vars.outputs.tag}}">
</head>
<body>
Nothing to see here; <a href="/${{steps.vars.outputs.tag}}">see the
latest version of the docs</a>.
</body>
</html>
EOF
- name: Copy index.html
if: ${{ steps.vars.outputs.tag != 'devel' }}
uses: ItsKarma/aws-cli@v1.70.0 uses: ItsKarma/aws-cli@v1.70.0
with: with:
# FIXME: `--website-redirect` uses a permanent redirect, therefore if args: s3 cp --cache-control max-age=0 ./index.html s3://docs.dagger.io/
# we use the latest version it will be in cache forever.
# args: s3 cp --cache-control max-age=0 --website-redirect /docs/${{steps.vars.outputs.tag}}/ ./index.html s3://docs.dagger.io/docs/
args: s3 cp --cache-control max-age=0 --website-redirect /devel/ ./index.html s3://docs.dagger.io/