-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c5e775b
commit 99d085a
Showing
1 changed file
with
24 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |