-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (61 loc) · 2.47 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
# This is a basic workflow to help you get started with Actions
name: CD
# Controls when the action will run. Triggers the workflow on push new tag.
on:
workflow_dispatch:
push:
tags:
- v*
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
env:
# For AWS construct
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
API_KEY: ${{ secrets.API_KEY }}
GENERAL_LOG_SUBSCRIPTION_EMAIL: ${{ secrets.GENERAL_LOG_SUBSCRIPTION_EMAIL }}
TELEGRAM_BOT_API_KEY_PARAMETER_NAME: ${{ secrets.TELEGRAM_BOT_API_KEY_PARAMETER_NAME }}
TELEGRAM_CHAT_ID_PARAMETER_NAME: ${{ secrets.TELEGRAM_CHAT_ID_PARAMETER_NAME }}
TELEGRAM_TEST_CHAT_ID_PARAMETER_NAME: ${{ secrets.TELEGRAM_TEST_CHAT_ID_PARAMETER_NAME }}
DISABLED_SCRAPE_HANDLERS: ${{ secrets.DISABLED_SCRAPE_HANDLERS }}
# For runtime (passed by AWS construct)
AWS_RUNTIME_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
API_CORS_WHITELIST: ${{ secrets.API_CORS_WHITELIST }}
DEPLOYMENT_GITHUB_ACCESS_TOKEN: ${{ secrets.DEPLOYMENT_GITHUB_ACCESS_TOKEN }}
DEPLOYMENT_GITHUB_OWNER: ${{ secrets.DEPLOYMENT_GITHUB_OWNER }}
DEPLOYMENT_GITHUB_REPO: ${{ secrets.DEPLOYMENT_GITHUB_REPO }}
DEPLOYMENT_GITHUB_WORKFLOW_ID: ${{ secrets.DEPLOYMENT_GITHUB_WORKFLOW_ID }}
DEPLOYMENT_GITHUB_WORKFLOW_REF: ${{ secrets.DEPLOYMENT_GITHUB_WORKFLOW_REF }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checkout master branch
- name: Checkout master branch
uses: actions/checkout@v2
with:
ref: master
# Setup node
- name: Setup Node with the right version
uses: actions/setup-node@v1
with:
node-version: "16.x"
registry-url: "https://registry.npmjs.org"
# Yarn install
- run: yarn install --frozen-lockfile
# Run lint test
- name: Run lint
run: yarn run lint
# Clear last build cache
- name: Clear last build cache
run: yarn run clear-build-cache
# Build
- name: Build
run: yarn run build
# CDK Deploy
- name: cdk deploy
run: yarn run deploy
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}