Skip to content

Commit 66ebecf

Browse files
committed
feat: add blob-uploader docker ci
1 parent 6d08239 commit 66ebecf

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/docker.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,51 @@ jobs:
9999
${{ env.ECR_REGISTRY }}/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
100100
${{ env.ECR_REGISTRY }}/${{ env.REPOSITORY }}:latest
101101
102+
blob_uploader:
103+
runs-on: ubuntu-latest
104+
steps:
105+
- name: Checkout code
106+
uses: actions/checkout@v4
107+
- name: Set up QEMU
108+
uses: docker/setup-qemu-action@v2
109+
- name: Set up Docker Buildx
110+
uses: docker/setup-buildx-action@v2
111+
- name: Login to Docker Hub
112+
uses: docker/login-action@v2
113+
with:
114+
username: ${{ secrets.DOCKERHUB_USERNAME }}
115+
password: ${{ secrets.DOCKERHUB_TOKEN }}
116+
- name: Configure AWS credentials
117+
uses: aws-actions/configure-aws-credentials@v4
118+
with:
119+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
120+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
121+
aws-region: ${{ env.AWS_REGION }}
122+
- name: Login to Amazon ECR
123+
id: login-ecr
124+
uses: aws-actions/amazon-ecr-login@v2
125+
- name: check repo and create it if not exist
126+
env:
127+
REPOSITORY: blob-uploader
128+
run: |
129+
aws --region ${{ env.AWS_REGION }} ecr describe-repositories --repository-names ${{ env.REPOSITORY }} && : || aws --region ${{ env.AWS_REGION }} ecr create-repository --repository-name ${{ env.REPOSITORY }}
130+
- name: Build and push
131+
uses: docker/build-push-action@v3
132+
env:
133+
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
134+
REPOSITORY: blob-uploader
135+
IMAGE_TAG: ${{ github.ref_name }}
136+
with:
137+
context: .
138+
file: ./build/dockerfiles/blob_uploader.Dockerfile
139+
platforms: linux/amd64,linux/arm64
140+
push: true
141+
tags: |
142+
scrolltech/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
143+
scrolltech/${{ env.REPOSITORY }}:latest
144+
${{ env.ECR_REGISTRY }}/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
145+
${{ env.ECR_REGISTRY }}/${{ env.REPOSITORY }}:latest
146+
102147
rollup-db-cli:
103148
runs-on: ubuntu-latest
104149
steps:

0 commit comments

Comments
 (0)