-
Notifications
You must be signed in to change notification settings - Fork 66
48 lines (40 loc) · 1.42 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Build, Analyze, and Scans
on:
push:
branches:
- main
jobs:
build-analyze-scan:
name: Build, Analyze, and Scan
runs-on: [self-hosted]
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- 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: NPM Install
run: npm install # Add your specific npm install command
- name: Docker Login
run: docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker Scout Scan
run: |
docker-scout quickview fs://.
docker-scout cves fs://.
- name: Docker build and push
run: |
# Run commands to build and push Docker images
docker build -t myntra .
docker tag myntra sevenajay/myntra:latest
docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}
docker push sevenajay/myntra:latest
env:
DOCKER_CLI_ACI: 1
- name: Docker Scout Image Scan
run: |
docker-scout quickview sevenajay/myntra:latest
docker-scout cves sevenajay/myntra:latest