Fixing Multiplatform Builds #198
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
--- | ||
######################### | ||
######################### | ||
## Deploy Docker Image Flavors ## | ||
######################### | ||
######################### | ||
# | ||
# Documentation: | ||
# https://help.github.com/en/articles/workflow-syntax-for-github-actions | ||
# | ||
####################################### | ||
# Start the job on all push to main # | ||
####################################### | ||
name: "Build & Deploy - ALPHA Flavors" | ||
on: | ||
push: | ||
branches: | ||
- "alpha" | ||
paths: | ||
- ".github/workflows/**" | ||
- "Dockerfile" | ||
- "flavors/**" | ||
- "megalinter/**" | ||
- "mega-linter-runner/**" | ||
- "server/**" | ||
- "**/linter-versions.json" | ||
- "TEMPLATES/**" | ||
- ".trivyignore" | ||
- "**/.sh" | ||
############### | ||
# Set the Job # | ||
############### | ||
concurrency: | ||
group: ${{ github.ref }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
jobs: | ||
build: | ||
# Name the Job | ||
name: Deploy Docker Image - ALPHA - Flavors | ||
permissions: | ||
packages: write | ||
# Only run this on the main repo | ||
if: github.repository == 'oxsecurity/megalinter' && !contains(github.event.head_commit.message, 'skip deploy') | ||
uses: ./.github/workflows/-build-docker.yml | ||
with: | ||
tagTemplate: "alpha" | ||
shouldLoginDockerHub: false | ||
shouldLoginGithub: true | ||
dockerfile: flavors/${{ matrix.flavor }}/Dockerfile | ||
push: true | ||
imageName: megalinter-${{ matrix.flavor }} | ||
workerImageName: megalinter-worker-${{ matrix.flavor }} | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 10 | ||
matrix: | ||
# flavors-start | ||
flavor: | ||
[ | ||
"ci_light", | ||
"cupcake", | ||
"documentation", | ||
"dotnet", | ||
"go", | ||
"java", | ||
"javascript", | ||
"php", | ||
"python", | ||
"ruby", | ||
"rust", | ||
"salesforce", | ||
"security", | ||
"swift", | ||
"terraform", | ||
] | ||
# flavors-end | ||
################## | ||
# Load all steps # | ||
################## | ||
steps: | ||
############################################## | ||
# Check Docker image security with Trivy # | ||
############################################## | ||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/trivy-action@master | ||
with: | ||
image-ref: 'docker.io/oxsecurity/megalinter-${{ matrix.flavor }}:alpha' | ||
format: 'table' | ||
exit-code: '1' | ||
ignore-unfixed: true | ||
scanners: vuln | ||
vuln-type: 'os,library' | ||
severity: 'CRITICAL,HIGH' | ||
timeout: 10m0s |