Skip to content

Commit

Permalink
deploy s3-proxy from CI
Browse files Browse the repository at this point in the history
  • Loading branch information
nl0 committed Mar 18, 2024
1 parent b50b725 commit a33be0b
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/deploy-s3proxy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Deploy S3 Proxy to ECR

on:
push:
branches:
- master
- deploy-s3proxy
paths:
- .github/workflows/deploy-s3proxy.yaml
- 's3-proxy/**'

jobs:
deploy-s3proxy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: s3-proxy
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- 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 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/s3-proxy
ECR_REPOSITORY_MP: quilt-data/quilt-payg-s3-proxy
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

0 comments on commit a33be0b

Please sign in to comment.