Skip to content

Merge pull request #1 from Dubcx/snyk-upgrade-cdbf893df72bb7386dcd127… #4

Merge pull request #1 from Dubcx/snyk-upgrade-cdbf893df72bb7386dcd127…

Merge pull request #1 from Dubcx/snyk-upgrade-cdbf893df72bb7386dcd127… #4

Workflow file for this run

name: Django # workflow name
on:
push:
branches: # similar to "only" in GitLab
- main
jobs:
build:
runs-on: ubuntu-latest # similar to "image" in GitLab
steps:
- run: echo "This is a build step" # similar to "script" in GitLab
test:
runs-on: ubuntu-latest
needs: build
steps:
- run: echo "This is a test step"
container_scanning:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: build local container
uses: docker/build-push-action@v2
with:
tags: django.nv:${{ github.sha }}
push: false
load: true
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: 'django.nv:${{ github.sha }}'
format: 'json'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'MEDIUM'
continue-on-error: true # allow the build to fail, similar to "allow_failure: true" in GitLab
integration:
runs-on: ubuntu-latest
needs: container_scanning
steps:
- run: echo "This is an integration step"
- run: exit 1
continue-on-error: true
prod:
runs-on: ubuntu-latest
needs: integration
steps:
- run: echo "This is a deploy step"