Skip to content

Commit

Permalink
Testing only base image
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpalms committed Feb 19, 2024
1 parent 4fa011a commit 2d9d8cc
Showing 1 changed file with 72 additions and 22 deletions.
94 changes: 72 additions & 22 deletions .github/workflows/images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ jobs:
- id: set-matrix
run: echo "::set-output name=matrix::$(./.github/workflows/generate-image-build-matrix images/*)"

build-and-push-arena-images:
build-base-image:
name: Build Arena Base Image
needs: [generate-matrix]
runs-on: ubuntu-latest
if: ${{ needs.generate-matrix.outputs.matrix != '[]' }}
strategy:
fail-fast: true
matrix:
include: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}

python_version: ${{ fromJson(needs.generate-matrix.outputs.matrix).base }}
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -34,6 +34,7 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
Expand All @@ -48,26 +49,75 @@ jobs:
username: diambra+github
password: ${{ secrets.QUAY_TOKEN }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/diambra/arena-${{ matrix.name }}
docker.io/diambra/arena-${{ matrix.name }}
quay.io/diambra/arena-${{ matrix.name }}
tags: |
type=ref,event=branch
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push arena ${{ matrix.dir }}
- name: Build and push base image
uses: docker/build-push-action@v3
with:
context: .
file: ${{ matrix.dir }}/Dockerfile
file: images/base/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: ${{ matrix.build_args }}
tags: ghcr.io/diambra/arena-base:${{ github.sha }},docker.io/diambra/arena-base:${{ github.sha }},quay.io/diambra/arena-base:${{ github.sha }}
build-args: PYTHON_VERSION=${{ matrix.python_version }}
- name: Save base image
uses: actions/upload-artifact@v2
with:
name: base-image
path: ${{ runner.workspace }}/images/base

#build-and-push-arena-libs-images:
# name: Build Arena Libs Image
# needs: [generate-matrix]
# runs-on: ubuntu-latest
# if: ${{ needs.generate-matrix.outputs.matrix != '[]' }}
# strategy:
# fail-fast: true
# matrix:
# include: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
#
# steps:
# - name: Checkout
# uses: actions/checkout@v2
#
# - name: Login to GHCR
# uses: docker/login-action@v2
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
#
# - name: Login to Docker Hub
# uses: docker/login-action@v2
# with:
# registry: docker.io
# username: diambrabot
# password: ${{ secrets.DOCKERHUB_TOKEN }}
#
# - name: Login to Quay
# uses: docker/login-action@v2
# with:
# registry: quay.io
# username: diambra+github
# password: ${{ secrets.QUAY_TOKEN }}
#
# - name: Docker meta
# id: meta
# uses: docker/metadata-action@v4
# with:
# images: |
# ghcr.io/diambra/arena-${{ matrix.name }}
# docker.io/diambra/arena-${{ matrix.name }}
# quay.io/diambra/arena-${{ matrix.name }}
# tags: |
# type=ref,event=branch
# type=semver,pattern=v{{version}}
# type=semver,pattern=v{{major}}.{{minor}}
# type=raw,value=latest,enable={{is_default_branch}}
#
# - name: Build and push arena ${{ matrix.dir }}
# uses: docker/build-push-action@v3
# with:
# context: .
# file: ${{ matrix.dir }}/Dockerfile
# push: true
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
# build-args: ${{ matrix.build_args }}

0 comments on commit 2d9d8cc

Please sign in to comment.