Skip to content

feat: remove Dockerfile and npm configuration files (#24) #5

feat: remove Dockerfile and npm configuration files (#24)

feat: remove Dockerfile and npm configuration files (#24) #5

Workflow file for this run

name: Build & Publish Docker Image
on:
push:
tags:
- 'v*' # Adjust this pattern if your tags are different
permissions:
packages: write
contents: read
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Normalize repository name (lowercase)
id: repo
run: |
repo_lower=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
echo "repo=$repo_lower" >> $GITHUB_OUTPUT
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build & Push Vanilla Docker image
run: |
docker build \
-f docker/Dockerfile \
-t ghcr.io/${{ steps.repo.outputs.repo }}:${GITHUB_REF_NAME} \
-t ghcr.io/${{ steps.repo.outputs.repo }}:latest \
.
docker push ghcr.io/${{ steps.repo.outputs.repo }} --all-tags
- name: Build & Push Scanner specific Docker image
run: |
docker build \
-f docker/cnspec.Dockerfile \
-t ghcr.io/${{ steps.repo.outputs.repo }}:${GITHUB_REF_NAME}-cnspec \
-t ghcr.io/${{ steps.repo.outputs.repo }}:latest-cnspec \
.
docker build \
-f docker/snyk.Dockerfile \
-t ghcr.io/${{ steps.repo.outputs.repo }}:${GITHUB_REF_NAME}-snyk \
-t ghcr.io/${{ steps.repo.outputs.repo }}:latest-snyk \
.
docker push ghcr.io/${{ steps.repo.outputs.repo }} --all-tags