Create images #79
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
# This workflow creates docker images that are then used for: | |
# | |
# - AIDASoft packages CI | |
# | |
# All created images are then uploaded to GitHub Container registry and docker hub | |
name: Create images | |
on: | |
push: | |
workflow_dispatch: | |
schedule: | |
# every Sunday | |
- cron: '0 0 * * 0' | |
permissions: | |
packages: write | |
jobs: | |
# Image for running LCG views | |
build: | |
strategy: | |
matrix: | |
image: ["centos7", "centos8", "el9"] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: build | |
run: | | |
echo $PWD | |
ls -l | |
docker build -t ${{ matrix.image }} ${{ matrix.image }}/ | |
- name: tag | |
run: | | |
docker tag ${{ matrix.image }} ghcr.io/aidasoft/${{ matrix.image }}:latest | |
- name: show | |
run: docker images | |
- name: login and push | |
env: | |
deploy_secret: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
if [ ! -z ${deploy_secret} ]; then | |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io --username ${{ github.actor }} --password-stdin; | |
docker push ghcr.io/aidasoft/${{ matrix.image }}:latest; | |
else | |
echo "Skipping deploy no secrets present"; | |
fi | |
# Image for running Coverity | |
coverity: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: download | |
run: | | |
cd coverity | |
wget https://scan.coverity.com/download/linux64 --post-data "token=${{ secrets.COVERITY_TOKEN }}&project=AIDASoft%2FDD4hep" -O coverity_tool.tgz | |
wget https://scan.coverity.com/download/linux64 --post-data "token=${{ secrets.COVERITY_TOKEN }}&project=AIDASoft%2FDD4hep&md5=1" -O coverity_tool.md5 | |
md5sum -c <<< "`cat coverity_tool.md5` coverity_tool.tgz" | |
mkdir cov-analysis-linux64 | |
tar -xf coverity_tool.tgz --strip-components=1 -C cov-analysis-linux64 | |
cd .. | |
- name: build | |
run: | | |
echo $PWD | |
ls -l | |
docker build -t coverity coverity/ | |
- name: tag | |
run: | | |
docker tag coverity ghcr.io/aidasoft/coverity:el9 | |
- name: show | |
run: docker images | |
- name: login and push | |
env: | |
deploy_secret: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
if [ ! -z ${deploy_secret} ]; then | |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io --username ${{ github.actor }} --password-stdin; | |
docker push ghcr.io/aidasoft/coverity:el9; | |
else | |
echo "Skipping deploy no secrets present"; | |
fi |