-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
1 changed file
with
34 additions
and
23 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,25 +1,36 @@ | ||
on: | ||
# Trigger analysis when pushing in master or pull requests, and when creating | ||
# a pull request. | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
name: Build Ecr Image | ||
on: | ||
push: | ||
branches: [ "main" ] | ||
|
||
name: SonarQube Scan | ||
jobs: | ||
sonarqube: | ||
name: SonarQube Trigger | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checking out | ||
uses: actions/checkout@master | ||
with: | ||
# Disabling shallow clone is recommended for improving relevancy of reporting | ||
fetch-depth: 0 | ||
- name: SonarQube Scan | ||
uses: kitabisa/[email protected] | ||
with: | ||
host: ${{ secrets.SONARQUBE_HOST }} | ||
login: ${{ secrets.SONARQUBE_TOKEN }} | ||
ECR-Build: | ||
|
||
|
||
name: Build Docker Image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup AWS ECR Details | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-east-1 | ||
|
||
|
||
- name: Login to Amazon ECR | ||
id: login-pf-aws-ecr | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
|
||
|
||
- name: Build and push the tagged docker image to Amazon ECR | ||
env: | ||
ECR_REGISTRY: 600453241670.dkr.ecr.us-east-1.amazonaws.com | ||
ECR_REPOSITORY: next-docker | ||
IMAGE_TAG: latest | ||
run: | | ||
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . | ||
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG |