Skip to content

Commit

Permalink
test: print matrix bake in GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
adamblake committed Jan 9, 2025
1 parent 284680b commit c935f09
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 33 deletions.
47 changes: 18 additions & 29 deletions .github/workflows/bake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ on:
type: boolean
required: false
default: false
update-conda:
description: Whether to update Conda packages
type: boolean
registry:
description: The registry to push to
type: string
required: false
default: false
default: ghcr.io/coursekata

jobs:
docker:
Expand All @@ -48,23 +48,6 @@ jobs:
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}

# - name: Login to Docker Registry
# uses: docker/login-action@v3
# with:
# username: ${{ vars.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_TOKEN }}

# - name: Setup Pixi
# if: inputs.target != 'base' && inputs.update-conda
# uses: prefix-dev/[email protected]
# with:
# run-install: false

# - name: Update Conda packages
# if: inputs.target != 'base' && inputs.update-conda
# shell: bash
# run: pixi update

# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3

Expand All @@ -80,19 +63,25 @@ jobs:
type=schedule,pattern={{date 'YYYY-MM-DD'}}
type=sha
- name: Test Bake
# - name: Build and push
# uses: docker/bake-action@v5
# with:
# files: docker-bake.hcl,${{ steps.meta.outputs.bake-file-labels }}
# targets: ${{ inputs.target }}
# push: true
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# TAGS: ${{ steps.meta.outputs.tags }}
# REGISTRY: ${{ inputs.registry }}

- name: Test Bakefile
run: |
docker buildx bake \
-f docker-bake.hcl \
-f ${{ steps.meta.outputs.bake-file-labels }} \
--print \
${{ inputs.target }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAGS: ${{ steps.meta.outputs.tags }}

# - name: Build and push
# uses: docker/bake-action@v5
# with:
# files: docker-bake.hcl,${{ steps.meta.outputs.bake-file }}
# targets: ${{ inputs.target }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REGISTRY: ${{ inputs.registry }}
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
name: Bake Images
name: Make Test Baked Images

on:
workflow_dispatch:
push:
branches: [feature/*]
paths:
- .github/workflows/publish2.yml
- .github/workflows/bake.yml
- docker-bake.hcl
- pixi.lock
- pixi.toml
Expand All @@ -30,3 +31,22 @@ jobs:
secrets: inherit
with:
target: base

images:
needs: [base]
uses: ./.github/workflows/bake.yml
secrets: inherit
with:
target: ${{ matrix.target }}
free-disk-space: true
registry: ghcr.io/coursekata/test
strategy:
fail-fast: false
matrix:
target:
- base-r
- essentials
- r
- datascience
- ckcode
- deepnote-datascience-r
4 changes: 1 addition & 3 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ target "docker-metadata-action" {
"org.opencontainers.image.created": "${TIMESTAMP}",
"org.opencontainers.image.revision": "${REVISION}",
"org.opencontainers.image.version": "${VERSION}",
# this is set by the ubuntu base image to "ubuntu". we should override it to be something like
# "datascience-notebook:sha-1234567", but we don't have that information here. we'll set it
# when building on GitHub Actions
# this is set by the ubuntu base image to "ubuntu": we can't unset it, so we clear it
"org.opencontainers.image.ref.name": "",
}
}
Expand Down

0 comments on commit c935f09

Please sign in to comment.