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 c5e775b commit 99d085a
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions .github/workflows/build_push_to_ecr.yaml
Original file line number Diff line number Diff line change
@@ -1,45 +1,47 @@
name: GitHub Actions Demo
on: [push]
name: build release and push to ECR
on: [release]
jobs:
Explore-GitHub-Actions:
build_and_push:
runs-on: ubuntu-latest
steps:
- run: echo "πŸŽ‰ The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "πŸ”Ž The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v2
- run: echo "πŸ’‘ The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "πŸ–₯️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."

- name: Checkout
uses: actions/checkout@v2

- name: Login to Public ECR
uses: docker/login-action@v1
with:
registry: public.ecr.aws
registry: public.ecr.aws/m4k8r3n4
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
env:
AWS_REGION: us-east-1

-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Set up JDK 1.11
uses: actions/[email protected]
with:
distribution: 'openjdk' # See 'Supported distributions' for available options
java-version: '11'

- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Maven package
run: mvn package -B

- name: Build and push Docker images
uses: docker/[email protected]
with:
context: .
platforms: linux/amd64,linux/arm64
platforms: linux/amd64
push: true
tags: |
public.ecr.aws/m4k8r3n4/k8s-demo-app:latest

0 comments on commit 99d085a

Please sign in to comment.