mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Fix docker push
github action and expand with additional metadata (#1837)
* update docker build (cloud) action with additional metadata, new labels * (docker) also add aarch64 cloud build and remove arch suffix * (docker) architecture suffix is needed for now * (docker) don't build aarch64 for now
This commit is contained in:
parent
556081695a
commit
1fc1eeec38
47
.github/workflows/build-cloud-img.yml
vendored
47
.github/workflows/build-cloud-img.yml
vendored
@ -4,9 +4,12 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- development
|
|
||||||
tags:
|
tags:
|
||||||
- v*
|
- v*
|
||||||
|
# we will NOT push the image on pull requests, only test buildability.
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@ -21,36 +24,56 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
# only x86_64 for now. aarch64+cuda isn't really a thing yet
|
|
||||||
arch:
|
arch:
|
||||||
- x86_64
|
- x86_64
|
||||||
|
# requires resolving a patchmatch issue
|
||||||
|
# - aarch64
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: ${{ matrix.arch }}
|
name: ${{ matrix.arch }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
if: matrix.arch == 'aarch64'
|
||||||
|
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v4
|
||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
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: |
|
tags: |
|
||||||
|
type=edge,branch=main
|
||||||
type=ref,event=branch
|
type=ref,event=branch
|
||||||
type=ref,event=tag
|
type=ref,event=tag
|
||||||
type=ref,event=pr
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
type=sha
|
type=sha
|
||||||
|
# suffix image tags with architecture
|
||||||
|
flavor: |
|
||||||
|
latest=auto
|
||||||
|
suffix=-${{ matrix.arch }},latest=true
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
# - if: github.event_name != 'pull_request'
|
# do not login to container registry on PRs
|
||||||
# name: Docker login
|
- if: github.event_name != 'pull_request'
|
||||||
# uses: docker/login-action@v2
|
name: Docker login
|
||||||
# with:
|
uses: docker/login-action@v2
|
||||||
# registry: ghcr.io
|
with:
|
||||||
# username: ${{ github.actor }}
|
registry: ghcr.io
|
||||||
# password: ${{ secrets.GITHUB_TOKEN }}
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push cloud image
|
- name: Build and push cloud image
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v3
|
||||||
@ -58,7 +81,7 @@ jobs:
|
|||||||
context: .
|
context: .
|
||||||
file: docker-build/Dockerfile.cloud
|
file: docker-build/Dockerfile.cloud
|
||||||
platforms: Linux/${{ matrix.arch }}
|
platforms: Linux/${{ matrix.arch }}
|
||||||
# push: ${{ github.event_name != 'pull_request' }}
|
# do not push the image on PRs
|
||||||
push: false
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user