-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (56 loc) · 1.97 KB
/
build-main.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
---
name: Staging/Prod | Build And Deploy
on:
push:
branches: [main]
env:
REGISTRY: ghcr.io
jobs: # We need two separate builds as each is going to a different ECR repo
build-staging:
permissions:
packages: write
id-token: write
uses: elastic-ipfs/shared-workflows/.github/workflows/lambda-shared-build.yaml@main
secrets:
aws_account_id: ${{ secrets.AWS_ACCOUNT_ID }}
aws_role_id: ${{ secrets.AWS_ROLE_ID }}
aws_region: ${{ secrets.AWS_REGION }}
aws_ecr_repository: ${{ secrets.AWS_ECR_REPOSITORY_STAGING }}
build-prod:
permissions:
packages: write
id-token: write
uses: elastic-ipfs/shared-workflows/.github/workflows/lambda-shared-build.yaml@main
secrets:
aws_account_id: ${{ secrets.AWS_ACCOUNT_ID }}
aws_role_id: ${{ secrets.AWS_ROLE_ID }}
aws_region: ${{ secrets.AWS_REGION }}
aws_ecr_repository: ${{ secrets.AWS_ECR_REPOSITORY }}
deploy-to-staging:
uses: elastic-ipfs/shared-workflows/.github/workflows/lambda-shared-deploy.yaml@main
permissions:
id-token: write
needs: build-staging
with:
deploy_to_environment: staging
lambda: staging-ep-indexer
docker_image_version: ${{ needs.build-staging.outputs.build_date }}
secrets:
aws_account_id: ${{ secrets.AWS_ACCOUNT_ID }}
aws_role_id: ${{ secrets.AWS_ROLE_ID }}
aws_region: ${{ secrets.AWS_REGION }}
aws_ecr_repository: ${{ secrets.AWS_ECR_REPOSITORY_STAGING }}
deploy-to-prod:
uses: elastic-ipfs/shared-workflows/.github/workflows/lambda-shared-deploy.yaml@main
permissions:
id-token: write
needs: build-prod
with:
deploy_to_environment: prod
lambda: indexer
docker_image_version: ${{ needs.build-prod.outputs.build_date }}
secrets:
aws_account_id: ${{ secrets.AWS_ACCOUNT_ID }}
aws_role_id: ${{ secrets.AWS_ROLE_ID }}
aws_region: ${{ secrets.AWS_REGION }}
aws_ecr_repository: ${{ secrets.AWS_ECR_REPOSITORY }}