Skip to content

Commit

Permalink
Update build_push_to_ecr.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiansirch authored Jul 9, 2021
1 parent 8944944 commit a5e6f6d
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/build_push_to_ecr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ jobs:

- name: Checkout
uses: actions/checkout@v2

- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV


- name: Login to Public ECR
uses: docker/login-action@v1
Expand Down Expand Up @@ -42,13 +40,25 @@ jobs:
- name: Maven package
run: mvn package -B


-
name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: public.ecr.aws/m4k8r3n4/k8s-demo-app
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and push Docker images
uses: docker/build-push-action@v2.6.1
with:
context: .
platforms: linux/amd64
push: true
tags: |
public.ecr.aws/m4k8r3n4/k8s-demo-app:latest
public.ecr.aws/m4k8r3n4/k8s-demo-app:$RELEASE_VERSION
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit a5e6f6d

Please sign in to comment.