-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (88 loc) · 2.99 KB
/
scheduler.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
name: Scheduler
on:
push:
branches:
- main
permissions:
id-token: write
contents: read
jobs:
build-web:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::082113759242:role/github_oidc_role
aws-region: eu-central-1
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22.11.0'
- name: Install Yarn
run: npm install -g [email protected]
- name: Install dependencies
working-directory: web
run: yarn install
- name: Build project
working-directory: web
run: yarn build
- name: Upload to S3
working-directory: web
run: |
aws s3 sync ./build s3://schafkopf-web-082113759242 --delete
build-api:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::082113759242:role/github_oidc_role
aws-region: eu-central-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Build, tag, and push docker image to Amazon ECR
run: |
docker build -f ./schafkopf/api/Dockerfile -t 082113759242.dkr.ecr.eu-central-1.amazonaws.com/schafkopf-api-lambda:latest .
docker push 082113759242.dkr.ecr.eu-central-1.amazonaws.com/schafkopf-api-lambda:latest
build-scheduler:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::082113759242:role/github_oidc_role
aws-region: eu-central-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Build, tag, and push docker image to Amazon ECR
run: |
docker build -f ./schafkopf/scheduler/Dockerfile -t 082113759242.dkr.ecr.eu-central-1.amazonaws.com/schafkopf-scheduler-lambda:latest .
docker push 082113759242.dkr.ecr.eu-central-1.amazonaws.com/schafkopf-scheduler-lambda:latest
deploy:
runs-on: ubuntu-latest
needs:
- build-scheduler
- build-api
steps:
- uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::082113759242:role/github_oidc_role
aws-region: eu-central-1
- name: Set up Terraform
uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.9.8
- name: Initialize Terraform
working-directory: infrastructure
run: terraform init
- name: Terraform Apply
working-directory: infrastructure
run: terraform apply -auto-approve