Skip to content

Commit

Permalink
Environment testing for gh workflows [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
robballantyne committed Apr 13, 2024
1 parent efadabb commit 7e6edc4
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build-env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build Env

on:
workflow_dispatch:

env:
UBUNTU_VERSION: 22.04
BUILDX_NO_DEFAULT_ATTESTATIONS: 1
# Conservative defaults for cloud providers
LATEST_CPU: "newbase-2.2.0-py3.10-cpu-22.04"

jobs:
cpu-base:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
var:
- {python: "3.10", pytorch: "2.2.0"}
steps:
-
name: Env Setter
run: |
echo "PACKAGE_NAME=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV}
-
name: Set tags
run: |
img_path="ghcr.io/${{ env.PACKAGE_NAME }}"
echo "Image Path: ${img_path}"
ver_tag="newbase-${{ matrix.var.pytorch }}-py${{ matrix.var.python }}-cpu-${{ env.UBUNTU_VERSION }}"
echo "Ver Tag: ${ver_tag}"
COMFYUI_SHA="$(curl -fsSL "https://api.github.com/repos/comfyanonymous/ComfyUI/commits/master" \ | jq -r '.sha[0:7]')"
[ -z "$COMFYUI_SHA" ] && { echo "Error: COMFYUI_SHA is empty. Exiting script." >&2; exit 1; }
sha_tag="${COMFYUI_SHA}-${ver_tag}"
echo "SHA Tag: ${sha_tag}"
TAGS="${img_path}:${ver_tag}, ${img_path}:${sha_tag}"
if [[ $ver_tag == ${{ env.LATEST_CPU }} ]]; then
echo "Marking latest"
TAGS+=", ${img_path}:latest-cpu, ${img_path}:latest-cpu-jupyter"
fi
echo "All Tags: ${TAGS}"
echo "COMFYUI_SHA=${COMFYUI_SHA}" >> ${GITHUB_ENV}
echo "TAGS=${TAGS}" >> ${GITHUB_ENV}
# Print envs
env

0 comments on commit 7e6edc4

Please sign in to comment.