Skip to content

Deploy "coinprice-" by @preschian #97

Deploy "coinprice-" by @preschian

Deploy "coinprice-" by @preschian #97

Workflow file for this run

name: Deploy to Cloudflare workers
run-name: Deploy "${{ inputs.worker }}-${{ inputs.environment }}" by @${{ github.actor }}
on:
workflow_dispatch:
inputs:
worker:
description: 'Name of the worker'
required: true
environment:
description: 'Choose an environment to deploy to: <beta|production>'
required: false
default: ''
commands:
description: 'Precommands'
default: 'npm install'
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
steps:
- uses: actions/checkout@v3
- name: Publish (beta or production)
if: github.event.inputs.environment == 'beta' || github.event.inputs.environment == 'production'
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
preCommands: ${{ github.event.inputs.commands }}
workingDirectory: ${{ github.event.inputs.worker }}
command: publish --env ${{ github.event.inputs.environment }}
- name: Publish (default)
if: github.event.inputs.environment != 'beta' && github.event.inputs.environment != 'production'
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
preCommands: ${{ github.event.inputs.commands }}
workingDirectory: ${{ github.event.inputs.worker }}