-
Notifications
You must be signed in to change notification settings - Fork 5
60 lines (57 loc) · 1.98 KB
/
deploy-registry.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
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: '20'
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 }}