Skip to content

Docker Image CI

Docker Image CI #41

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "main" ]
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: false
default: 'warning'
type: choice
options:
- info
- warning
print_tags:
description: 'True to print to STDOUT'
required: false
type: boolean
tags:
description: 'Test scenario tags'
required: false
type: string
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
steps:
- uses: actions/checkout@v3
- name: Set up maven
uses: s4u/[email protected]
with:
java-version: '11'
maven-version: '3.6.3'
- name: docker login
run: docker login -u=citelibre -p="${{ secrets.PASSWORD_DOCKER_CITELIBRE }}"
- name: Get new version
run: echo "VERSION=latest">> $GITHUB_ENV
- name: Display version
run: echo "version $VERSION"
- name: build war ihm
run: cd citelibre-serviceEZ
- name: build serviceEZ
run: docker build citelibre-serviceEZ -t citelibre/serviceEZ:ihm-$VERSION
- name: Save serviceEZ
run: docker save -o citelibre-serviceEZ.tar citelibre/serviceEZ:ihm-$VERSION
- name: Run Trivy vulnerability scanner in tarball mode of rendez vous image
uses: aquasecurity/trivy-action@master
with:
input: /github/workspace/citelibre-serviceEZ.tar
severity: 'CRITICAL,HIGH'
format: 'sarif'
output: 'trivy-results.sarif'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'trivy-results.sarif'
- name: build mysql
run: docker build mysql -t citelibre/serviceEZ:db-$VERSION
- name: build matomo
run: docker build matomo -t citelibre/serviceEZ:matomo-$VERSION
- name: build solr
run: docker build solr -t citelibre/serviceEZ:solr-$VERSION
- name: build keycloak
run: docker build keycloak -t citelibre/serviceEZ:keycloak-$VERSION
- name: build kibana
run: docker build kibana -t citelibre/serviceEZ:kibana-$VERSION
- name: build elasticsearch
run: docker build elasticsearch -t citelibre/serviceEZ:elasticsearch-$VERSION
- name: push images on docker hub
run: |
docker push citelibre/serviceEZ:solr-$VERSION
docker push citelibre/serviceEZ:db-$VERSION
docker push citelibre/serviceEZ:matomo-$VERSION
docker push citelibre/serviceEZ:keycloak-$VERSION
docker push citelibre/serviceEZ:ihm-$VERSION
docker push citelibre/serviceEZ:kibana-$VERSION
docker push citelibre/serviceEZ:elasticsearch-$VERSION