-
Notifications
You must be signed in to change notification settings - Fork 5
94 lines (82 loc) · 2.75 KB
/
deploy.yml
File metadata and controls
94 lines (82 loc) · 2.75 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Deploy
on:
workflow_dispatch:
inputs:
development:
type: boolean
description: 'Deploy to development environment'
required: false
default: true
production:
type: boolean
description: 'Deploy to production environment'
required: false
default: true
stage:
type: boolean
description: 'Deploy to stage environment'
required: false
default: false
test:
type: boolean
description: 'Deploy to test environment'
required: false
default: false
all:
type: boolean
description: 'Deploy to all environments'
required: false
default: false
push:
branches: [develop]
concurrency:
group: deploy-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
env:
ACTIONS_RUNNER_DEBUG: true
NODE_OPTIONS: '--no-warnings'
jobs:
checks:
uses: './.github/workflows/checks.yml'
deploy-workers:
if: ${{ !contains(github.event.head_commit.message, '[skip-deploy]') }}
needs: [checks]
timeout-minutes: 3
runs-on: ['ubuntu-latest']
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
# Supabase database url
DEVELOPMENT_DATABASE: ${{ secrets.DATABASE_URL }}
PRODUCTION_DATABASE: null
steps:
- name: '🔑 Checkout'
uses: actions/checkout@v4.1.1
- name: '🐰 Setup Bun'
uses: oven-sh/setup-bun@v1
with:
bun-version: 'latest'
- name: 'Install Dependencies'
run: bun install
- name: 'Get Commit SHA'
id: get_commit_sha
run: echo "COMMIT_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
# https://developers.cloudflare.com/workers/wrangler/commands/#deploy
- name: '[development] Deploy Cloudflare Workers 🔶'
uses: ethereumfollowprotocol/actions/.github/actions/deploy-cloudflare-worker@main
with:
env: "development"
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
vars: '{"COMMIT_SHA": "${{ steps.get_commit_sha.outputs.COMMIT_SHA }}"}'
# https://developers.cloudflare.com/workers/wrangler/commands/#deploy
- name: '[production] Deploy Cloudflare Workers 🔶'
uses: ethereumfollowprotocol/actions/.github/actions/deploy-cloudflare-worker@main
with:
env: "production"
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
vars: '{"COMMIT_SHA": "${{ steps.get_commit_sha.outputs.COMMIT_SHA }}"}'