-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (93 loc) · 2.37 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Deploy
on:
push:
branches: develop
pull_request:
branches: master
types: [closed]
jobs:
test:
name: Test
runs-on: ubuntu-latest
env:
APP_ENV: test
BOT_TOKEN: dummy
SUPABASE_URL: ${{secrets.SUPABASE_URL}}
SUPABASE_KEY: ${{secrets.SUPABASE_KEY}}
SUPABASE_SCHEMA: test
steps:
- name: Setup repo
uses: actions/checkout@v4
- uses: denoland/setup-deno@main
with:
deno-version: v1.x
- name: Cache Dependencies
run: deno cache src/bot.ts
- name: Run Tests
run: deno task test
coverage:
name: Coverage
runs-on: ubuntu-latest
env:
APP_ENV: test
BOT_TOKEN: dummy
SUPABASE_URL: ${{secrets.SUPABASE_URL}}
SUPABASE_KEY: ${{secrets.SUPABASE_KEY}}
SUPABASE_SCHEMA: test
steps:
- name: Setup repo
uses: actions/checkout@v4
- uses: denoland/setup-deno@main
with:
deno-version: v1.x
- name: Run Coverage
run: deno task coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.5.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
format-and-lint:
name: Format and Lint
runs-on: ubuntu-latest
env:
APP_ENV: test
BOT_TOKEN: dummy
SUPABASE_URL: ${{secrets.SUPABASE_URL}}
SUPABASE_KEY: ${{secrets.SUPABASE_KEY}}
SUPABASE_SCHEMA: test
steps:
- name: Setup repo
uses: actions/checkout@v4
- uses: denoland/setup-deno@main
with:
deno-version: v1.x
- name: Run Format
run: deno fmt --check
- name: Run Lint
run: deno lint
deploy:
name: Deploy
runs-on: ubuntu-latest
needs:
- test
- format-and-lint
environment:
name: ${{github.ref_name}}
permissions:
id-token: write # Needed for auth with Deno Deploy
contents: read # Needed to clone the repository
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Install Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Upload to Deno Deploy
uses: denoland/deployctl@v1
env:
APP_ENV: ${{vars.APP_ENV}}
with:
project: "hn-telegram-bot"
entrypoint: "src/webhook.ts"
root: "."