-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (39 loc) · 1.12 KB
/
Copy pathnode.yml
File metadata and controls
48 lines (39 loc) · 1.12 KB
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: Node CI
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- name: Install dependencies
run: npm install
working-directory: labs/github-actions/testing-lab
- name: Run tests
run: npm test
working-directory: labs/github-actions/testing-lab
- name: Build Docker image
run: |
docker build \
-t my-first-image \
labs/docker/dockerfile-lab
- name: Scan Docker image with Trivy
uses: aquasecurity/trivy-action@master
with:
image-ref: my-first-image
format: table
severity: CRITICAL
exit-code: 0
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Push Docker image
run: |
docker tag my-first-image wendev27/my-first-image:latest
docker push wendev27/my-first-image:latest