Skip to content

Commit 1c02a11

Browse files
committed
add publish image github action
1 parent 6de8865 commit 1c02a11

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: docker-cloud go publish
2+
on: push
3+
jobs:
4+
publish:
5+
runs-on: ubuntu-latest
6+
defaults:
7+
run:
8+
working-directory: docker-cloud
9+
steps:
10+
- uses: actions/checkout@v3
11+
- name: Login to Amazon ECR Public
12+
id: login-ecr-public
13+
uses: aws-actions/amazon-ecr-login@v1
14+
with:
15+
registry-type: public
16+
- name: Build, tag, and push docker image to Amazon ECR Public
17+
env:
18+
REGISTRY: ${{ steps.login-ecr-public.outputs.registry }}
19+
REGISTRY_ALIAS: w0k4j6h5
20+
REPOSITORY: immersive-go-course/docker-cloud
21+
IMAGE_TAG: ${{ github.sha }}
22+
run: |
23+
docker build -t $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG .
24+
docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG

0 commit comments

Comments
 (0)