-
Notifications
You must be signed in to change notification settings - Fork 90
69 lines (67 loc) · 2.45 KB
/
deploy-catalog.yaml
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
name: Deploy catalog to ECR
on:
push:
branches:
- master
- selective-package-download
paths:
- '.github/workflows/deploy-catalog.yaml'
- 'catalog/**'
- 'shared/**'
jobs:
deploy-catalog-ecr:
runs-on: ubuntu-latest
defaults:
run:
working-directory: catalog
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: 'catalog/package.json'
cache: 'npm'
cache-dependency-path: 'catalog/package-lock.json'
- run: npm ci
- run: npm run build
- name: Configure AWS credentials from Prod account
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::730278974607:role/github/GitHub-Quilt
aws-region: us-east-1
- name: Login to Prod ECR
id: login-prod-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Login to MP ECR
id: login-mp-ecr
uses: aws-actions/amazon-ecr-login@v2
with:
registries: 709825985650
- name: Configure AWS credentials from GovCloud account
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws-us-gov:iam::313325871032:role/github/GitHub-Quilt
aws-region: us-gov-east-1
- name: Login to GovCloud ECR
id: login-govcloud-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Build and push Docker image to Prod, MP and GovCloud ECR
env:
ECR_REGISTRY_PROD: ${{ steps.login-prod-ecr.outputs.registry }}
ECR_REGISTRY_GOVCLOUD: ${{ steps.login-govcloud-ecr.outputs.registry }}
ECR_REGISTRY_MP: ${{ steps.login-mp-ecr.outputs.registry }}
ECR_REPOSITORY: quiltdata/catalog
ECR_REPOSITORY_MP: quilt-data/quilt-payg-catalog
IMAGE_TAG: ${{ github.sha }}
run: |
docker buildx build \
-t $ECR_REGISTRY_PROD/$ECR_REPOSITORY:$IMAGE_TAG \
-t $ECR_REGISTRY_GOVCLOUD/$ECR_REPOSITORY:$IMAGE_TAG \
-t $ECR_REGISTRY_MP/$ECR_REPOSITORY_MP:$IMAGE_TAG \
.
docker push $ECR_REGISTRY_PROD/$ECR_REPOSITORY:$IMAGE_TAG
docker push $ECR_REGISTRY_GOVCLOUD/$ECR_REPOSITORY:$IMAGE_TAG
docker push $ECR_REGISTRY_MP/$ECR_REPOSITORY_MP:$IMAGE_TAG