mirror of
https://github.com/cloudflare/wrangler-action.git
synced 2024-11-24 19:04:46 +01:00
org
This commit is contained in:
parent
c3eb4af3f6
commit
aab7849afe
1 changed files with 18 additions and 25 deletions
|
@ -6,30 +6,6 @@ export HOME="/github/workspace"
|
|||
export NVM_DIR="/github/workspace/nvm"
|
||||
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
|
||||
function sanitize() {
|
||||
if [ -z "${1}" ]; then
|
||||
|
@ -38,4 +14,21 @@ function sanitize() {
|
|||
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue