wrangler-action/entrypoint.sh

28 lines
785 B
Bash
Raw Normal View History

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"
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
if [ -n "$CLOUDFLARE_API_KEY" ]; then
echo "CLOUDFLARE_API_KEY env var needs to be set. Add this field in the 'Secrets' section of your repo's settings."
exit 1
fi
if [ -n "$CLOUDFLARE_EMAIL" ]; then
echo "CLOUDFLARE_EMAIL env var needs to be set. Add this field in the 'Secrets' section of your repo's settings."
exit 1
fi
2019-10-07 21:41:21 +02:00
npm i @cloudflare/wrangler -g
2019-10-11 20:01:57 +02:00
npm i
2019-10-07 21:41:21 +02:00
wrangler whoami
wrangler publish