Deploy Registry Worker #372
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Registry Worker | |
on: | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: 'Choose an environment to deploy to: <dev|prod>' | |
required: true | |
default: 'dev' | |
branch: | |
description: 'Choose an branch to deploy:' | |
required: false | |
default: 'v3/prod' | |
registry: | |
description: 'Set a registry to deploy: <configuration|exchanges|oracles|tokens|vaults|data>' | |
required: true | |
default: '' | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
environment: ${{ github.event.inputs.environment || 'dev' }} | |
name: Deploy Registry | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.event.inputs.branch || 'v3/prod' }} | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
cache: 'yarn' | |
- run: yarn install --frozen-lockfile | |
- name: Wrangler Publish Registry | |
if: ${{ github.event.inputs.registry != 'data' }} | |
shell: bash | |
run: > | |
yarn nx run-many | |
--target=publish-wrangler | |
--projects=registry-${{ github.event.inputs.registry }} | |
--env ${{ github.event.inputs.environment || 'dev' }} | |
--var NX_COMMIT_REF:${{ github.sha }} | |
env: | |
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_WORKER_TOKEN }} | |
- name: Wrangler Publish Data | |
if: ${{ github.event.inputs.registry == 'data' }} | |
shell: bash | |
run: > | |
yarn nx run-many | |
--target=publish-wrangler | |
--projects=data | |
--env ${{ github.event.inputs.environment || 'dev' }} | |
--var NX_COMMIT_REF:${{ github.sha }} | |
env: | |
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_WORKER_TOKEN }} |