mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
c0c4d7ca69
* update build scripts and dockerignore updates to build and run script: - read repository name - include flavor in container name - read arch via arch command - use latest tag instead of arch - don't bindmount `$HOME/.huggingface` - make sure HUGGINGFACE_TOKEN is set updates to .dockerignore - include environment-and-requirements - exclude binary_installer - exclude docker-build - exclude docs * disable push and pr triggers of cloud image also disable pushing. This was decided since: - it is not multiarch useable - the default image is already cloud aproved * integrate patchmatch in container * pin verisons of recently introduced dependencies * remove now unecesarry part from build.sh move huggingface token to run script, so it can download missing models * move GPU_FLAGS to run script since not needed at build time * update env.sh - read REPOSITORY_NAME from env if available - add comment to explain the intension of this file - remove unecesarry exports * get rid of repository_name_lc * capitalize variables * update INSTALL_DOCKER with new variables * add comments pointing to the docs Co-authored-by: Lincoln Stein <lincoln.stein@gmail.com>
88 lines
2.2 KiB
YAML
88 lines
2.2 KiB
YAML
name: Build and push cloud image
|
|
on:
|
|
workflow_dispatch:
|
|
# push:
|
|
# branches:
|
|
# - main
|
|
# tags:
|
|
# - v*
|
|
# # we will NOT push the image on pull requests, only test buildability.
|
|
# pull_request:
|
|
# branches:
|
|
# - main
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
env:
|
|
REGISTRY: ghcr.io
|
|
IMAGE_NAME: ${{ github.repository }}
|
|
|
|
jobs:
|
|
docker:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
arch:
|
|
- x86_64
|
|
# requires resolving a patchmatch issue
|
|
# - aarch64
|
|
runs-on: ubuntu-latest
|
|
name: ${{ matrix.arch }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v2
|
|
if: matrix.arch == 'aarch64'
|
|
|
|
- name: Docker meta
|
|
id: meta
|
|
uses: docker/metadata-action@v4
|
|
with:
|
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
# see https://github.com/docker/metadata-action
|
|
# will push the following tags:
|
|
# :edge
|
|
# :main (+ any other branches enabled in the workflow)
|
|
# :<tag>
|
|
# :1.2.3 (for semver tags)
|
|
# :1.2 (for semver tags)
|
|
# :<sha>
|
|
tags: |
|
|
type=edge,branch=main
|
|
type=ref,event=branch
|
|
type=ref,event=tag
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=sha
|
|
# suffix image tags with architecture
|
|
flavor: |
|
|
latest=auto
|
|
suffix=-${{ matrix.arch }},latest=true
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
# do not login to container registry on PRs
|
|
- if: github.event_name != 'pull_request'
|
|
name: Docker login
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build and push cloud image
|
|
uses: docker/build-push-action@v3
|
|
with:
|
|
context: .
|
|
file: docker-build/Dockerfile.cloud
|
|
platforms: Linux/${{ matrix.arch }}
|
|
# do not push the image on PRs
|
|
push: false
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|