This commit is contained in:
Kristian Freeman 2019-10-11 14:30:51 -05:00
parent c3eb4af3f6
commit aab7849afe

View file

@ -6,30 +6,6 @@ export HOME="/github/workspace"
export NVM_DIR="/github/workspace/nvm" export NVM_DIR="/github/workspace/nvm"
export WRANGLER_HOME="/github/workspace" export WRANGLER_HOME="/github/workspace"
function install_nvm() {
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"
}
function main() {
mkdir -p "$HOME/.wrangler"
chmod -R 777 "$HOME/.wrangler"
install_nvm
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
}
# h/t https://github.com/elgohr/Publish-Docker-Github-Action # h/t https://github.com/elgohr/Publish-Docker-Github-Action
function sanitize() { function sanitize() {
if [ -z "${1}" ]; then if [ -z "${1}" ]; then
@ -38,4 +14,21 @@ function sanitize() {
fi fi
} }
main 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