Skip to content

Commit

Permalink
Update sonar.yml
Browse files Browse the repository at this point in the history
Aj7Ay authored Oct 19, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 56492ae commit 881b893
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,35 @@
name: Build
name: Build and Push Docker Image

on:
push:
branches:
- main


jobs:
build:
name: Build
build-and-push:
name: Build and Push Docker Image
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- uses: sonarsource/sonarqube-scan-action@master

- name: Build and analyze with SonarQube
uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}

- name: Build Docker image
run: |
docker build -t sevenajay/netflix:latest .
docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}
docker push sevenajay/netflix:latest
env:
DOCKER_CLI_ACI: 1

# If you wish to fail your job when the Quality Gate is red, uncomment the
# following lines. This would typically be used to fail a deployment.
# - uses: sonarsource/sonarqube-quality-gate-action@master

0 comments on commit 881b893

Please sign in to comment.