mirror of
https://github.com/cloudflare/wrangler-action.git
synced 2024-11-24 10:54:46 +01:00
Add environment support, change input names
This commit is contained in:
parent
26e61bb08a
commit
c09ecc83b5
2 changed files with 16 additions and 8 deletions
|
@ -4,9 +4,11 @@ runs:
|
|||
using: 'docker'
|
||||
image: 'Dockerfile'
|
||||
inputs:
|
||||
CLOUDFLARE_API_KEY:
|
||||
apiKey:
|
||||
description: "Your Cloudflare API Key"
|
||||
required: true
|
||||
CLOUDFLARE_EMAIL:
|
||||
email:
|
||||
description: "Your Cloudflare Email"
|
||||
required: true
|
||||
environment:
|
||||
description: "The environment you'd like to publish your Workers project to - must be defined in wrangler.toml"
|
||||
|
|
|
@ -22,15 +22,21 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash
|
|||
mkdir -p "$HOME/.wrangler"
|
||||
chmod -R 777 "$HOME/.wrangler"
|
||||
|
||||
sanitize "${INPUT_CLOUDFLARE_EMAIL}" "CLOUDFLARE_EMAIL"
|
||||
sanitize "${INPUT_CLOUDFLARE_API_KEY}" "CLOUDFLARE_API_KEY"
|
||||
sanitize "${INPUT_CLOUDFLAREEMAIL}" "CLOUDFLARE_EMAIL"
|
||||
sanitize "${INPUT_CLOUDFLAREAPI_KEY}" "CLOUDFLARE_API_KEY"
|
||||
|
||||
export CF_EMAIL="$INPUT_CLOUDFLARE_EMAIL"
|
||||
export CF_API_KEY="$INPUT_CLOUDFLARE_API_KEY"
|
||||
export CF_EMAIL="$INPUT_CLOUDFLAREEMAIL"
|
||||
export CF_API_KEY="$INPUT_CLOUDFLAREAPIKEY"
|
||||
|
||||
npm i @cloudflare/wrangler -g
|
||||
npm i
|
||||
|
||||
wrangler whoami
|
||||
wrangler publish
|
||||
ls
|
||||
|
||||
if [ -z "$INPUT_ENVIRONMENT" ]
|
||||
then
|
||||
wrangler publish -e "$INPUT_ENVIRONMENT"
|
||||
else
|
||||
wrangler publish
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue