Skip to content

Commit be22db7

Browse files
committed
ci: push docker image to ecr public and github container registries
1 parent 93142be commit be22db7

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

.github/workflows/docker.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ on:
1010
branches: [master]
1111

1212
jobs:
13-
push_to_registry:
14-
name: Push Docker image to Docker Hub
13+
push_to_registries:
14+
name: Push Docker image to Docker Hub, ECR Public, GitHub Container Registry
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Check out the repo
@@ -29,11 +29,30 @@ jobs:
2929
username: ${{ secrets.DOCKER_HUB_USERNAME }}
3030
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
3131

32+
- name: Login to ECR Public
33+
uses: docker/login-action@v1
34+
with:
35+
registry: public.ecr.aws
36+
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
37+
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
38+
env:
39+
AWS_REGION: us-east-1
40+
41+
- name: Login to GitHub Container Registry
42+
uses: docker/login-action@v1
43+
with:
44+
registry: ghcr.io
45+
username: ${{ github.actor }}
46+
password: ${{ secrets.GITHUB_TOKEN }}
47+
3248
- name: Extract metadata (tags, labels) for Docker
3349
id: meta
3450
uses: docker/metadata-action@v3
3551
with:
36-
images: bchew/dynamodump
52+
images: |
53+
${{ github.repository }}
54+
public.ecr.aws/a7p1j9f6/dynamodump
55+
ghcr.io/${{ github.repository }}
3756
3857
- name: Build and push Docker image
3958
uses: docker/build-push-action@v2

0 commit comments

Comments
 (0)