Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add environment support, change input names
  • Loading branch information
Kristian Freeman committed Oct 14, 2019
1 parent 26e61bb commit c09ecc8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
6 changes: 4 additions & 2 deletions action.yml
Expand Up @@ -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"
18 changes: 12 additions & 6 deletions entrypoint.sh
Expand Up @@ -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

0 comments on commit c09ecc8

Please sign in to comment.