Skip to content

Commit 2ae8c15

Browse files
committed
ci: only release on aws when released
1 parent b768858 commit 2ae8c15

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/workflows/aws.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
name: Publish to Amazon ECR
2828

2929
on:
30-
push:
31-
branches: [ "main" ]
30+
release:
31+
types: [released]
3232

3333
env:
3434
AWS_REGION: us-east-1 # set this to your preferred AWS region, e.g. us-west-1
@@ -67,9 +67,10 @@ jobs:
6767

6868
- name: Build, tag, and push image to Amazon ECR
6969
id: build-image
70+
if: github.ref_type == 'tag'
7071
env:
7172
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
72-
IMAGE_TAG: ${{ github.sha }}
73+
IMAGE_TAG: ${{ github.ref_name }}
7374
run: |
7475
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
7576
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG

0 commit comments

Comments
 (0)