|
1 | 1 | name: Docker Image CI
|
2 | 2 |
|
3 |
| - |
4 | 3 | on:
|
5 | 4 | push:
|
6 |
| - branches: [ main, develop, feature/* ] |
| 5 | + branches: [main, develop, feature/*] |
7 | 6 | pull_request:
|
8 |
| - branches: [ main ] |
| 7 | + branches: [main] |
9 | 8 |
|
10 | 9 | permissions: read-all
|
11 | 10 |
|
12 | 11 | jobs:
|
13 |
| - |
14 | 12 | build:
|
15 | 13 | name: Build & Test in Docker
|
16 | 14 |
|
17 | 15 | runs-on: ubuntu-latest
|
18 | 16 |
|
19 | 17 | steps:
|
20 |
| - - uses: actions/checkout@v4 |
21 |
| - - name: Build the Docker image |
22 |
| - run: make compose/rebuild |
23 |
| - - name: Run test in Docker image |
24 |
| - run: make compose/run |
25 |
| - - name: Tag Docker image |
26 |
| - run: docker tag algorithm-exercises-csharp:latest algorithm-exercises-csharp:${{ github.sha }} |
27 |
| - |
28 |
| - - name: Run Snyk to check Docker image for vulnerabilities |
29 |
| - # Snyk can be used to break the build when it detects vulnerabilities. |
30 |
| - # In this case we want to upload the issues to GitHub Code Scanning |
31 |
| - continue-on-error: true |
32 |
| - uses: snyk/actions/docker@master |
33 |
| - env: |
34 |
| - # In order to use the Snyk Action you will need to have a Snyk API token. |
35 |
| - # See https://docs.snyk.io/integrations/ci-cd-integrations/github-actions-integration#getting-your-snyk-token |
36 |
| - # or you can sign up for free at https://snyk.io/login |
37 |
| - SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} |
38 |
| - with: |
39 |
| - image: algorithm-exercises-csharp:latest |
40 |
| - args: --file=Dockerfile |
| 18 | + - uses: actions/checkout@v4 |
| 19 | + - name: Build the Docker image |
| 20 | + run: make compose/rebuild |
| 21 | + - name: Run static checks in Docker image |
| 22 | + run: make compose/lint |
| 23 | + - name: Run test in Docker image |
| 24 | + run: make compose/run |
| 25 | + - name: Tag Docker image |
| 26 | + run: docker tag algorithm-exercises-csharp:latest algorithm-exercises-csharp:${{ github.sha }} |
| 27 | + |
| 28 | + - name: Run Snyk to check Docker image for vulnerabilities |
| 29 | + # Snyk can be used to break the build when it detects vulnerabilities. |
| 30 | + # In this case we want to upload the issues to GitHub Code Scanning |
| 31 | + continue-on-error: true |
| 32 | + uses: snyk/actions/docker@master |
| 33 | + env: |
| 34 | + # In order to use the Snyk Action you will need to have a Snyk API token. |
| 35 | + # See https://docs.snyk.io/integrations/ci-cd-integrations/github-actions-integration#getting-your-snyk-token |
| 36 | + # or you can sign up for free at https://snyk.io/login |
| 37 | + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} |
| 38 | + with: |
| 39 | + image: algorithm-exercises-csharp:latest |
| 40 | + args: --file=Dockerfile |
41 | 41 | # - name: Upload result to GitHub Code Scanning
|
42 | 42 | # uses: github/codeql-action/upload-sarif@v2
|
43 | 43 | # with:
|
|
0 commit comments