Merge pull request #17 from Steavy/development #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | ||
on: | ||
push: | ||
branches: [ main ] | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: docker build . -t ${{secrets.DOCKERHUB_USERNAME}}/nest-demo-app | ||
- run: echo "${{secrets.DOCKERHUB_PASSWORD}}" | docker login -u ${{secrets.DOCKERHUB_USERNAME}} --password-stdin | ||
- run: docker push ${{secrets.DOCKERHUB_USERNAME}}/nest-demo-app | ||
snyk_image_scanning: | ||
permissions: | ||
id-token: read | ||
contents: read | ||
packages: read | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v2 | ||
- name: Log in to the Container registry 📦 | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.GITHUB_REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Scan Docker image 🐳 | ||
uses: snyk/actions/docker@master | ||
continue-on-error: true | ||
with: | ||
image: ${{ env.GITHUB_REGISTRY }}/${{ env.GITHUB_REPOSITORY }}:${{ env.DOCKER_IMAGE_TAG }} | ||
args: --file=Dockerfile --severity-threshold=high --sarif-file-output=snyk.sarif | ||
env: | ||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | ||
- name: Upload Snyk report as sarif 📦 | ||
uses: github/codeql-action/upload-sarif@v2 | ||
with: | ||
sarif_file: snyk.sarif |