2019-10-11 19:22:20 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
2019-10-07 22:19:11 +02:00
|
|
|
|
2019-10-11 20:01:57 +02:00
|
|
|
export HOME="/github/workspace"
|
|
|
|
export NVM_DIR="/github/workspace/nvm"
|
|
|
|
export WRANGLER_HOME="/github/workspace"
|
|
|
|
|
2019-10-11 21:25:47 +02:00
|
|
|
# h/t https://github.com/elgohr/Publish-Docker-Github-Action
|
|
|
|
function sanitize() {
|
|
|
|
if [ -z "${1}" ]; then
|
|
|
|
>&2 echo "Unable to find the ${2}. Did you set with.${2}?"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2019-10-11 21:30:51 +02:00
|
|
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash
|
|
|
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
|
|
|
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
|
|
|
|
|
|
|
|
mkdir -p "$HOME/.wrangler"
|
|
|
|
chmod -R 777 "$HOME/.wrangler"
|
|
|
|
|
|
|
|
_sanitize "${INPUT_EMAIL}" "email"
|
|
|
|
export CLOUDFLARE_EMAIL="$INPUT_EMAIL"
|
|
|
|
_sanitize "${INPUT_APIKEY}" "apiKey"
|
|
|
|
export CLOUDFLARE_API_KEY="$INPUT_APIKEY"
|
|
|
|
|
|
|
|
npm i @cloudflare/wrangler -g
|
|
|
|
npm i
|
|
|
|
|
|
|
|
wrangler whoami
|
|
|
|
wrangler publish
|
|
|
|
|