Skip to content

Commit

Permalink
tweaking GH Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mowsec committed Jan 23, 2024
1 parent 9f02768 commit d35b49b
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 7 deletions.
54 changes: 48 additions & 6 deletions .github/workflows/docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ on:

jobs:

build:
name: Docker Build
build-base:
name: Docker Build Base (no-agent)
runs-on: ubuntu-latest
steps:
-
Expand All @@ -32,21 +32,63 @@ jobs:
platforms: linux/amd64,linux/arm64
-
name: Build and push Docker images
uses: docker/build-push-action@v5.1.0
uses: docker/build-push-action@v5
with:
push: false
load: true
tags: contrastsecuritydemo/netflicks:latest-agent
tags: contrastsecuritydemo/netflicks:latest-no-agent

build-contrast:
name: Docker Build Contrast (agent)
runs-on: ubuntu-latest
steps:
-
name: Checkout branch
uses: actions/checkout@v4
-
name: Docker Setup QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
-
name: Docker Setup Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64
-
name: Build and push Docker images
uses: docker/build-push-action@v5
with:
push: false
load: true
tags: contrastsecuritydemo/netflicks:latest
outputs: type=docker,dest=/tmp/latest.tar
-
name: Upload docker build artifact for use in next job
uses: actions/upload-artifact@v3
with:
name: latest
path: /tmp/latest.tar


test:
name: Run Tests
runs-on: ubuntu-latest
needs:
- build
- build-base
- build-contrast
steps:
-
name: Download artifact
uses: actions/download-artifact@v4
with:
path: /tmp
merge-multiple: true
-
name: Load images
run: |
echo Testing now
docker load --input /tmp/latest-no-agent.tar
docker load --input /tmp/latest.tar
-
name: Checkout branch
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
- '1433:1433'

web:
image: contrastsecuritydemo/netflicks:latest-agent
image: contrastsecuritydemo/netflicks:latest
build:
context: .
dockerfile: Dockerfile.contrast
Expand Down

0 comments on commit d35b49b

Please sign in to comment.