Skip to content

Commit

Permalink
test: docker meta
Browse files Browse the repository at this point in the history
  • Loading branch information
adamblake committed Jan 8, 2025
1 parent 4163811 commit c3dcbd8
Show file tree
Hide file tree
Showing 2 changed files with 129 additions and 0 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/bake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
name: Build, Test, and Publish an Image

on:
workflow_call:
inputs:
target:
description: The target to bake
type: string
required: false
runs-on:
description: The runner to use
type: string
required: false
default: ubuntu-latest
free-disk-space:
description: Whether to free disk space before building
type: boolean
required: false
default: false
update-conda:
description: Whether to update Conda packages
type: boolean
required: false
default: false

jobs:
docker:
runs-on: ${{ inputs.runs-on }}

steps:
# - name: Free Disk Space (Ubuntu)
# if: inputs.free-disk-space
# uses: jlumbroso/free-disk-space@main
# with:
# dotnet: ${{ inputs.free-disk-space }}
# haskell: ${{ inputs.free-disk-space }}
# large-packages: ${{ inputs.free-disk-space }}
# swap-storage: ${{ inputs.free-disk-space }}

# - name: Checkout
# uses: actions/checkout@v4

# - name: Login to GitHub Container Registry
# uses: docker/login-action@v3
# with:
# registry: ghcr.io
# 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

# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3

- name: Image Metadata
id: meta
uses: docker/metadata-action@v5
with:
# images: |
# ${{ github.repository_owner }}/${{ inputs.target }}
# ghcr.io/${{ github.repository_owner }}/${{ inputs.target }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=schedule,pattern={{date 'YYYY-MM-DD'}}
type=sha
# - name: Build and push
# uses: docker/bake-action@v5
# with:
# files: docker-bake.hcl,${{ steps.meta.outputs.bake-file }}
# targets: ${{ inputs.target }}
39 changes: 39 additions & 0 deletions .github/workflows/publish2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Bake Images

on:
workflow_dispatch:
push:
branches: [feature/*]
paths:
- .github/workflows/publish2.yml
- docker-bake.hcl
- pixi.lock
- pixi.toml
- packages.yaml
- dockerfiles/**
- scripts/**
- assets/**
schedule:
# Weekly, at 03:00 on Monday UTC time (see https://crontab.guru)
- cron: "0 3 * * 1"

# https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
# only cancel in-progress jobs or runs for the current workflow - matches against branch & tags
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
foundation:
uses: ./.github/workflows/bake.yml
secrets: inherit
with:
target: foundation

base:
needs: [foundation]
uses: ./.github/workflows/bake.yml
secrets: inherit
with:
target: base

0 comments on commit c3dcbd8

Please sign in to comment.