Skip to content

Create g2hep #6

Create g2hep

Create g2hep #6

name: gentoo-scikit-hep Docker Image CI
on:
push:
branches: [ "master" ]
paths:
- gentoo/scikit-hep/Dockerfile
- .github/workflows/gentoo-scikit-hep.yml
schedule:
- cron: 0 6 14 * *
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
docker:
runs-on: ubuntu-latest
#runs-on: self-hosted
timeout-minutes: 4320 # 72h
strategy:
fail-fast: false
max-parallel: 1
matrix:
user: ["apnpucky"]
base: [ "gentoo" ]
image: [
"scikit-hep",
]
platforms: [
"linux/amd64",
#,linux/386, linux/arm64,linux/ppc64le,linux/riscv64,linux/arm/v5,linux/arm/v6,linux/arm/v7, #,linux/s390x,
]
scikit-hep: ["2023.08.01"]
steps:
-
name: Set up version
id: version
run: |
VERSION=${{ matrix.image }}
VERSION=${VERSION//scikit-hep/${{ matrix.scikit-hep }}}
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
-
name: Checkout
uses: actions/checkout@v3
-
name: Get current time
uses: josStorer/get-current-time@v2.0.2
id: current-time
with:
format: YYYYMMDDHHSS
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
config: .github/buildkitd.toml
-
name: Login to Docker Hub
uses: docker/#-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: abort on existing tag
id: abort
run: |
if docker manifest inspect ${{ matrix.user }}/${{ matrix.base }}-${{ matrix.image }}:${{ steps.version.outputs.VERSION }}-${{ github.sha }}-latest; then
echo "STOP"
echo "STOP=true" >> "$GITHUB_OUTPUT"
else
echo "DONT STOP"
echo "STOP=false" >> "$GITHUB_OUTPUT"
fi
-
name: ${{ matrix.base }}-${{ matrix.image }}
if: steps.abort.outputs.STOP == 'false'
uses: docker/build-push-action@v3
with:
file: gentoo/scikit-hep/Dockerfile
platforms: ${{ matrix.platforms }}
push: true
target: ${{ matrix.base }}-${{ matrix.image }}
build-args: |
SCIKIT_HEP_VERSION=${{ matrix.scikit-hep }}
tags: |
${{ matrix.user }}/${{ matrix.base }}-${{ matrix.image }}:latest
${{ matrix.user }}/${{ matrix.base }}-${{ matrix.image }}:${{ steps.version.outputs.VERSION }}-latest
${{ matrix.user }}/${{ matrix.base }}-${{ matrix.image }}:${{ steps.version.outputs.VERSION }}-${{ github.sha }}-latest
${{ matrix.user }}/${{ matrix.base }}-${{ matrix.image }}:${{ steps.version.outputs.VERSION }}-${{ steps.current-time.outputs.formattedTime }}-latest