-
Notifications
You must be signed in to change notification settings - Fork 44
54 lines (44 loc) · 1.7 KB
/
docker-test.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
49
50
51
52
53
54
name: Build Run and Test Docker Container
on:
workflow_dispatch:
push:
tags:
- '*.*.*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build and run Docker container
run: |
# Build your Docker image (replace 'oobee' and 'Dockerfile' with your image name and Dockerfile path)
docker build -t oobee .
# Run the Docker container (adjust any options as needed)
docker run -dit --name oobee-container oobee
# Ensure the Docker container is running before running the next step
continue-on-error: true
- name: Run Node CLI command inside the Docker container
run: |
# Execute a webisite crawl
docker exec oobee-container npm run cli -- -u "${{ vars.OOBEE_SCAN_URL }}" -c 2 -p "${{ vars.OOBEE_SCAN_MAX_NUM_PAGES }}" -t "${{ vars.OOBEE_SCAN_MAX_CONCURRENCY }}" -k "${{ github.actor }}:${{ github.actor }}@users.noreply.github.com" -b chromium || true
- name: Print errors
run: |
docker exec oobee-container cat errors.txt || true
- name: Print logs
run: |
docker exec oobee-container cat logs/*/*.txt || true
- name: Copy Results from Docker Container
run: docker cp oobee-container:/app/results ./results
- name: Zip Results
run: zip -r results.zip ./results
- name: Upload Zip File
uses: actions/upload-artifact@v4
with:
name: results
path: results.zip
- name: Cleanup Docker container
run: |
# Stop and remove the Docker container
docker stop oobee-container
docker rm oobee-container