-
Notifications
You must be signed in to change notification settings - Fork 167
71 lines (71 loc) · 3.03 KB
/
deploy.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
61
62
63
64
65
66
67
68
69
70
71
name: Manual Deploy
on:
workflow_dispatch:
inputs:
environment:
description: 'Choose an environment to deploy API to: <staging|production> (empty for dev)'
required: false
default: ''
frontend_cname:
description: 'Choose a Cloudflare Pages deployment to point the above environment to, ie: "2f7ade61.nft-storage.pages.dev". This will point <dev|staging>.nft.storage or nft.storage to 2f7ade61.nft-storage.pages.dev. ONLY point production environment to a production deployment.'
required: false
jobs:
deploy-api:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '18'
- uses: bahmutov/npm-install@v1
- name: Publish app
uses: cloudflare/[email protected]
env:
SENTRY_TOKEN: ${{ secrets.SENTRY_TOKEN}}
SENTRY_UPLOAD: ${{ secrets.SENTRY_UPLOAD }}
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
workingDirectory: 'packages/api'
environment: ${{ github.event.inputs.environment }}
- name: annotation dev
if: github.event.inputs.environment == ''
run: echo "::warning::https://api-dev.nft.storage"
- name: annotation staging
if: github.event.inputs.environment == 'staging'
run: echo "::warning::https://api-staging.nft.storage"
- name: annotation production
if: github.event.inputs.environment == 'production'
run: echo "::warning::https://api.nft.storage"
deploy-frontend-production:
if: github.event.inputs.environment == 'production'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '18'
- uses: bahmutov/npm-install@v1
- run: ./packages/tools/cli.js dns --name classic.nft.storage --token ${{ secrets.CF_API_TOKEN }} --zone ${{ secrets.CF_ZONE }} --content ${{ github.event.inputs.frontend_cname }}
- run: echo "::warning::https://classic.nft.storage"
deploy-frontend-staging:
if: github.event.inputs.environment == 'staging'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '18'
- uses: bahmutov/npm-install@v1
- run: ./packages/tools/cli.js dns --name classic-staging.nft.storage --token ${{ secrets.CF_API_TOKEN }} --zone ${{ secrets.CF_ZONE }} --content ${{ github.event.inputs.frontend_cname }}
- run: echo "::warning::https://classic-staging.nft.storage"
deploy-frontend-dev:
if: github.event.inputs.environment == ''
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '18'
- uses: bahmutov/npm-install@v1
- run: ./packages/tools/cli.js dns --name dev.nft.storage --token ${{ secrets.CF_API_TOKEN }} --zone ${{ secrets.CF_ZONE }} --content ${{ github.event.inputs.frontend_cname }}
- run: echo "::warning::https://dev.nft.storage"