build(deps): bump AWSSDK.SimpleEmail from 3.7.401.17 to 3.7.401.18 (#… #1407
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: Dockerize | |
on: | |
push: | |
branches: [ main ] | |
tags: | |
- v* | |
pull_request: | |
branches: [ main ] | |
env: | |
IMAGE_NAME: netcoreboilerplate | |
jobs: | |
build-docker-test: | |
runs-on: ubuntu-22.04 | |
if: github.event_name == 'pull_request' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: hadolint/hadolint-action@v3.1.0 | |
name: Lint Dockerfile | |
with: | |
dockerfile: Dockerfile | |
failure-threshold: error | |
- name: Build Image | |
run: docker build . -t $IMAGE_NAME | |
- name: Run Trivy vulnerability scanner | |
uses: aquasecurity/trivy-action@master | |
with: | |
image-ref: ${{ env.IMAGE_NAME }} | |
format: 'sarif' | |
output: 'trivy-results.sarif' | |
- name: Upload Trivy scan results to GitHub Security tab | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: 'trivy-results.sarif' | |
build-push-docker: | |
runs-on: ubuntu-22.04 | |
if: github.event_name == 'push' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
bervproject/${{ env.IMAGE_NAME }} | |
ghcr.io/${{ github.repository }} | |
- name: Build and push Docker images | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |