From 83f32f2210a4c2d52133025fdaa8ea0311c67d00 Mon Sep 17 00:00:00 2001 From: Dima Ryazanov Date: Fri, 9 Feb 2024 14:09:20 -0800 Subject: [PATCH 1/5] Deploy catalog from CI --- .github/workflows/deploy-catalog.yaml | 56 +++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/deploy-catalog.yaml diff --git a/.github/workflows/deploy-catalog.yaml b/.github/workflows/deploy-catalog.yaml new file mode 100644 index 00000000000..983ef87c4ad --- /dev/null +++ b/.github/workflows/deploy-catalog.yaml @@ -0,0 +1,56 @@ +name: Deploy catalog to ECR + +on: + push: + branches: + - master + paths: + - '.github/workflows/deploy-catalog.yaml' + - 'catalog/**' + - 'shared/**' + +jobs: + deploy-catalog-ecr: + runs-on: ubuntu-latest + defaults: + run: + working-directory: catalog + env: + NODE_OPTIONS: --max-old-space-size=4096 + # 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: '16.11' + 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: 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 and GovCloud ECR + run: | + docker build \ + -t ${{ steps.login-prod-ecr.outputs.registry }}/quiltdata/catalog:${{ github.sha }} \ + -t ${{ steps.login-govcloud-ecr.outputs.registry }}/quiltdata/catalog:${{ github.sha }} \ + . + docker push ${{ steps.login-prod-ecr.outputs.registry }}/quiltdata/catalog:${{ github.sha }} + docker push ${{ steps.login-govcloud-ecr.outputs.registry }}/quiltdata/catalog:${{ github.sha }} From 302f222cafe54615a866c652e9985065505cee0b Mon Sep 17 00:00:00 2001 From: Dima Ryazanov Date: Sun, 11 Feb 2024 23:34:49 -0800 Subject: [PATCH 2/5] use buildx --- .github/workflows/deploy-catalog.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-catalog.yaml b/.github/workflows/deploy-catalog.yaml index 983ef87c4ad..1e49bd05560 100644 --- a/.github/workflows/deploy-catalog.yaml +++ b/.github/workflows/deploy-catalog.yaml @@ -48,7 +48,7 @@ jobs: uses: aws-actions/amazon-ecr-login@v2 - name: Build and push Docker image to Prod and GovCloud ECR run: | - docker build \ + docker buildx build \ -t ${{ steps.login-prod-ecr.outputs.registry }}/quiltdata/catalog:${{ github.sha }} \ -t ${{ steps.login-govcloud-ecr.outputs.registry }}/quiltdata/catalog:${{ github.sha }} \ . From 370763ce2e905e32ad1e52d53d1dac956d0b9d08 Mon Sep 17 00:00:00 2001 From: Dima Ryazanov Date: Tue, 13 Feb 2024 14:43:08 -0800 Subject: [PATCH 3/5] remove NODE_OPTIONS --- .github/workflows/deploy-catalog.yaml | 2 -- .github/workflows/js-ci.yml | 2 -- 2 files changed, 4 deletions(-) diff --git a/.github/workflows/deploy-catalog.yaml b/.github/workflows/deploy-catalog.yaml index 1e49bd05560..f7c8c17478c 100644 --- a/.github/workflows/deploy-catalog.yaml +++ b/.github/workflows/deploy-catalog.yaml @@ -15,8 +15,6 @@ jobs: defaults: run: working-directory: catalog - env: - NODE_OPTIONS: --max-old-space-size=4096 # These permissions are needed to interact with GitHub's OIDC Token endpoint. permissions: id-token: write diff --git a/.github/workflows/js-ci.yml b/.github/workflows/js-ci.yml index 47ca43b59bb..9de67f266d6 100644 --- a/.github/workflows/js-ci.yml +++ b/.github/workflows/js-ci.yml @@ -12,8 +12,6 @@ jobs: defaults: run: working-directory: catalog - env: - NODE_OPTIONS: --max-old-space-size=4096 steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 From 6dee3641eb6b490c9cfafcb401ff012edd3bc77b Mon Sep 17 00:00:00 2001 From: Dima Ryazanov Date: Tue, 13 Feb 2024 14:43:41 -0800 Subject: [PATCH 4/5] remove cache --- .github/workflows/deploy-catalog.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/deploy-catalog.yaml b/.github/workflows/deploy-catalog.yaml index f7c8c17478c..126f4b40b28 100644 --- a/.github/workflows/deploy-catalog.yaml +++ b/.github/workflows/deploy-catalog.yaml @@ -24,8 +24,6 @@ jobs: - uses: actions/setup-node@v4 with: node-version: '16.11' - cache: 'npm' - cache-dependency-path: 'catalog/package-lock.json' - run: npm ci - run: npm run build - name: Configure AWS credentials from Prod account From b859d979b1f26cc76622ba34ea9bbb6441c7ea5f Mon Sep 17 00:00:00 2001 From: Alexei Mochalov Date: Wed, 14 Feb 2024 17:23:20 +0500 Subject: [PATCH 5/5] cache npm --- .github/workflows/deploy-catalog.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy-catalog.yaml b/.github/workflows/deploy-catalog.yaml index 126f4b40b28..8f262d5d5b6 100644 --- a/.github/workflows/deploy-catalog.yaml +++ b/.github/workflows/deploy-catalog.yaml @@ -24,6 +24,7 @@ jobs: - uses: actions/setup-node@v4 with: node-version: '16.11' + cache: 'npm' - run: npm ci - run: npm run build - name: Configure AWS credentials from Prod account