Skip to content

Commit

Permalink
chore: add push image to aws ecr (#155)
Browse files Browse the repository at this point in the history
* chore: add push image to aws ecr

* chore: change image name

* chore: add registry type

* chore: change workflow push to aws private ecr
  • Loading branch information
daviderli614 authored Jul 24, 2024
1 parent c5c1dad commit 87811df
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/dev-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,22 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ var.ECR_REGION }}

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to Amazon ECR
uses: aws-actions/amazon-ecr-login@v2

- name: Login to AliCloud Container Registry
uses: docker/login-action@v3
with:
Expand All @@ -85,6 +95,8 @@ jobs:
greptime/greptimedb-operator-dev:${{ env.VERSION }}
greptime-registry.cn-hangzhou.cr.aliyuncs.com/greptime/greptimedb-operator-dev:latest
greptime-registry.cn-hangzhou.cr.aliyuncs.com/greptime/greptimedb-operator-dev:${{ env.VERSION }}
${{ var.ECR_REGISTRY }}/greptime/greptimedb-operator-dev:latest
${{ var.ECR_REGISTRY }}/greptime/greptimedb-operator-dev:${{ env.VERSION }}
- name: Build and push initializer
uses: docker/build-push-action@v5
Expand All @@ -98,3 +110,5 @@ jobs:
greptime/greptimedb-initializer-dev:${{ env.VERSION }}
greptime-registry.cn-hangzhou.cr.aliyuncs.com/greptime/greptimedb-initializer-dev:latest
greptime-registry.cn-hangzhou.cr.aliyuncs.com/greptime/greptimedb-initializer-dev:${{ env.VERSION }}
${{ var.ECR_REGISTRY }}/greptime/greptimedb-initializer-dev:latest
${{ var.ECR_REGISTRY }}/greptime/greptimedb-initializer-dev:${{ env.VERSION }}
14 changes: 14 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ var.ECR_REGION }}

- name: Login to DockerHub
uses: docker/login-action@v3
with:
Expand All @@ -49,6 +56,9 @@ jobs:
username: ${{ secrets.ALICLOUD_USERNAME }}
password: ${{ secrets.ALICLOUD_PASSWORD }}

- name: Login to Amazon ECR
uses: aws-actions/amazon-ecr-login@v2

- name: Configure tag
shell: bash
run: |
Expand All @@ -66,6 +76,8 @@ jobs:
greptime/greptimedb-operator:${{ env.VERSION }}
greptime-registry.cn-hangzhou.cr.aliyuncs.com/greptime/greptimedb-operator:latest
greptime-registry.cn-hangzhou.cr.aliyuncs.com/greptime/greptimedb-operator:${{ env.VERSION }}
${{ var.ECR_REGISTRY }}/greptime/greptimedb-operator:latest
${{ var.ECR_REGISTRY }}/greptime/greptimedb-operator:${{ env.VERSION }}
- name: Build and push initializer
uses: docker/build-push-action@v5
Expand All @@ -78,6 +90,8 @@ jobs:
greptime/greptimedb-initializer:${{ env.VERSION }}
greptime-registry.cn-hangzhou.cr.aliyuncs.com/greptime/greptimedb-initializer:latest
greptime-registry.cn-hangzhou.cr.aliyuncs.com/greptime/greptimedb-initializer:${{ env.VERSION }}
${{ var.ECR_REGISTRY }}/greptime/greptimedb-initializer:latest
${{ var.ECR_REGISTRY }}/greptime/greptimedb-initializer:${{ env.VERSION }}
release:
name: Release the artifacts
Expand Down

0 comments on commit 87811df

Please sign in to comment.