Skip to content

Create images

Create images #94

# 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", "ubuntu2204"]
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:latest
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:latest;
docker push ghcr.io/aidasoft/coverity:el9;
else
echo "Skipping deploy no secrets present";
fi