#!/bin/bash

set -o errexit
set -o nounset

export LC_ALL=C.UTF-8
export LANG=C.UTF-8

STDLIB_TOKEN=$1
if [[ ${STDLIB_TOKEN} == "" ]]
then
  echo "STDLIB_TOKEN needs to be supplied as first script argument."
  exit 1
fi

ponyc packages/stdlib --docs-public --pass expr
sed -i 's/site_name:\ stdlib/site_name:\ Pony Standard Library/' stdlib-docs/mkdocs.yml

echo "Uploading docs using mkdocs..."
git config --global --add safe.directory /__w/ponyc/ponyc
git remote add gh-token "https://${STDLIB_TOKEN}@github.com/ponylang/stdlib.ponylang.io"
git fetch gh-token
git reset gh-token/main
pushd stdlib-docs
mkdocs gh-deploy -v --clean --remote-name gh-token --remote-branch main
popd

#!/bin/bash

set -o errexit
set -o nounset

export LC_ALL=C.UTF-8
export LANG=C.UTF-8

STDLIB_TOKEN=$1
if [[ ${STDLIB_TOKEN} == "" ]]
then
  echo "STDLIB_TOKEN needs to be supplied as first script argument."
  exit 1
fi

ponyc packages/stdlib --docs-public --pass expr
sed -i 's/site_name:\ stdlib/site_name:\ Pony Standard Library/' stdlib-docs/mkdocs.yml

echo "Uploading docs using mkdocs..."
git config --global --add safe.directory "${GITHUB_WORKSPACE}"
git remote add gh-token "https://${STDLIB_TOKEN}@github.com/ponylang/stdlib.ponylang.io"
git fetch gh-token
git reset gh-token/main
pushd stdlib-docs
mkdocs gh-deploy -v --clean --remote-name gh-token --remote-branch main
popd

Make recent git version fix less brittle
Make recent git version fix less brittle
