-
-
Notifications
You must be signed in to change notification settings - Fork 12
95 lines (77 loc) · 2.33 KB
/
Copy pathaws-deploy-prod.yaml
File metadata and controls
95 lines (77 loc) · 2.33 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
95
name: deploy-aws-prod
on:
push:
branches:
- main
paths:
- .github/workflows/aws-deploy-prod.yaml
- crawler/**
- frontend/**
- cdk/**
- types/**
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# run every 12 hours
schedule:
- cron: "0 */12 * * *"
concurrency:
group: production
cancel-in-progress: false
env:
NODE_VERSION: 22.17.0
CDK_DISABLE_CLI_TELEMETRY: true
jobs:
aws_deploy_prod:
runs-on: ubuntu-latest
environment:
name: production
url: https://lemmyverse.net
steps:
# https://github.com/actions/toolkit/issues/946#issuecomment-1590016041
- name: root suid tar
run: sudo chown root:root /bin/tar && sudo chmod u+s /bin/tar
- uses: actions/checkout@v4
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
# Download + Start Redis Docker
- name: Get Dump + Start Redis
uses: ./.github/actions/start-redis
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
s3-bucket: ${{ vars.DATA_S3_BUCKET }}
# Yarn Install ./crawler
- name: Yarn Install ./crawler
uses: ./.github/actions/yarn-install
with:
working-directory: ./crawler
# Run Crawler Output Script
- name: Run Health Script
run: yarn health
working-directory: ./crawler
- name: Run Output Script
run: yarn output
working-directory: ./crawler
# Yarn Install ./frontend
- name: Yarn Install ./frontend
uses: ./.github/actions/yarn-install
with:
working-directory: ./frontend
- name: Build the Frontend
run: yarn build
working-directory: ./frontend
- name: Create CDK Config JSON
id: create-json
uses: jsdaniell/create-json@v1.2.3
with:
dir: ./cdk
name: "config.json"
json: ${{ vars.CONFIG_JSON }}
# CDK Deployment
- name: CDK Deployment
uses: ./.github/actions/cdk-deploy
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}