Skip to content

Commit 77faa61

Browse files
authored
Merge pull request #64 from sir-gon/develop
Develop
2 parents d974496 + 8ee60c9 commit 77faa61

File tree

3 files changed

+29
-37
lines changed

3 files changed

+29
-37
lines changed

.github/workflows/docker-image.yml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
name: Docker Image CI
22

3-
43
on:
54
push:
6-
branches: [ main, develop, feature/* ]
5+
branches: [main, develop, feature/*]
76
pull_request:
8-
branches: [ main ]
7+
branches: [main]
98

109
permissions: read-all
1110

1211
jobs:
13-
1412
build:
1513
name: Build & Test in Docker
1614

1715
runs-on: ubuntu-latest
1816

1917
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
4141
# - name: Upload result to GitHub Code Scanning
4242
# uses: github/codeql-action/upload-sarif@v2
4343
# with:

Dockerfile

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,7 @@ ENV WORKDIR=/app
55
WORKDIR ${WORKDIR}
66

77
###############################################################################
8-
FROM node:22.2.0-alpine3.19 AS lint
9-
10-
ENV WORKDIR=/app
11-
WORKDIR ${WORKDIR}
12-
13-
COPY ./docs ${WORKDIR}/docs
14-
RUN apk add --update --no-cache make
15-
RUN npm install -g markdownlint-cli
8+
FROM node:20.14.0-alpine3.20 AS mdlint
169

1710
ENV WORKDIR=/app
1811
WORKDIR ${WORKDIR}

compose.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ services:
1515
image: algorithm-exercises-csharp:mdlint
1616
build:
1717
context: .
18-
target: lint
18+
target: mdlint
1919
# environment:
20-
# LOG_LEVEL: ${LOG_LEVEL:-info} ## (1) ## info | debug
21-
# BRUTEFORCE: ${BRUTEFORCE:-false} ## (1) ## true | false
20+
# LOG_LEVEL: ${LOG_LEVEL:-info} ## (1) ## info | debug
21+
# BRUTEFORCE: ${BRUTEFORCE:-false} ## (1) ## true | false
2222
volumes:
2323
- ./:/app
2424
profiles: ["lint"]
@@ -34,7 +34,6 @@ services:
3434
volumes:
3535
- ./:/app
3636
profiles: ["development"]
37-
3837
## REFERENCES:
3938
## (1) Passing Environment variable with fallback value:
4039
## https://stackoverflow.com/a/70772707/6366150

0 commit comments

Comments
 (0)