Skip to content

Commit

Permalink
1.0.50 Add variables to the github action
Browse files Browse the repository at this point in the history
  • Loading branch information
webpwnized committed Oct 16, 2023
1 parent b539dc0 commit b700c57
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 18 deletions.
42 changes: 25 additions & 17 deletions .github/workflows/build-and-push-to-dockerhub.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
name: build-push-dockerhub
name: build-scan-push-to-dockerhub

on:
push:
branches:
- 'main'

env:
DATABASE_CONTAINER_NAME: "database"
DATABASE_ADMIN_CONTAINER_NAME: "database_admin"
LDAP_CONTAINER_NAME: "ldap"
LDAP_ADMIN_CONTAINER_NAME: "ldap_admin"
WEB_CONTAINER_NAME: "www"

jobs:
docker:
runs-on: ubuntu-latest
Expand All @@ -20,11 +27,11 @@ jobs:
echo "VERSION=$VERSION" >> $GITHUB_ENV
-
name: Set up QEMU
name: Set up QEMU on the runner
uses: docker/setup-qemu-action@v3

-
name: Set up Docker Buildx
name: Set up Docker Buildx on the runner
uses: docker/setup-buildx-action@v3

-
Expand All @@ -35,44 +42,45 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}

-
name: Build and Export Database Container to Docker
name: Build and Export ${{ env,DATABASE_CONTAINER_NAME }} Container to Docker
uses: docker/build-push-action@v5
with:
context: .
file: ./database/Dockerfile
file: ./${{ env,DATABASE_CONTAINER_NAME }}/Dockerfile
load: true
tags: webpwnized/mutillidae:database
tags: webpwnized/mutillidae:${{ env,DATABASE_CONTAINER_NAME }}

-
name: Run Trivy vulnerability scanner on Database Container
name: Run Trivy vulnerability scanner on ${{ env,DATABASE_CONTAINER_NAME }} Container
uses: aquasecurity/trivy-action@master
with:
image-ref: 'webpwnized/mutillidae:database'
image-ref: 'webpwnized/mutillidae:${{ env,DATABASE_CONTAINER_NAME }}'
format: 'sarif'
output: 'database-trivy-results.sarif'
output: '${{ env,DATABASE_CONTAINER_NAME }}-trivy-scan-results.sarif'

-
name: Upload Database Container Trivy scan results to GitHub Security tab
name: Upload ${{ env,DATABASE_CONTAINER_NAME }} Container Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'database-trivy-results.sarif'
sarif_file: '${{ env,DATABASE_CONTAINER_NAME }}-trivy-scan-results.sarif'

-
name: Build and push database container
name: Build and push ${{ env,DATABASE_CONTAINER_NAME }} container
uses: docker/build-push-action@v5
with:
context: .
file: ./database/Dockerfile
file: ./${{ env,DATABASE_CONTAINER_NAME }}/Dockerfile
push: true
tags: webpwnized/mutillidae:database
tags: webpwnized/mutillidae:${{ env,DATABASE_CONTAINER_NAME }}

-
name: Build and push database container
name: Build and push ${{ env,DATABASE_CONTAINER_NAME }} container with version number
uses: docker/build-push-action@v5
with:
context: .
file: ./database/Dockerfile
file: ./${{ env,DATABASE_CONTAINER_NAME }}/Dockerfile
push: true
tags: webpwnized/mutillidae:database-${{ env.VERSION }}
tags: webpwnized/mutillidae:${{ env,DATABASE_CONTAINER_NAME }}-${{ env.VERSION }}

-
name: Build and push database_admin container
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.49
1.0.50

0 comments on commit b700c57

Please sign in to comment.