Merge branch 'enricoros:v2-dev' into v2-dev #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
# GitHub recommends pinning actions to a commit SHA. | |
# To get a newer version, you will need to update the SHA. | |
# You can also reference a tag or branch, but the action may change without warning. | |
name: Create and publish Docker images | |
on: | |
push: | |
branches: | |
- v2-dev | |
#- v1-dev # Disabled because this is not needed anymore | |
#- v1-stable # Disabled as the v* tag is used for stable releases | |
tags: | |
- 'v*' # Trigger on version tags (e.g., v1.7.0) | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build-and-push-image: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
security-events: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
tags: | | |
type=raw,value=development,enable=${{ github.ref == 'refs/heads/v2-dev' }} # For v2-dev branch | |
type=raw,value=stable,enable=${{ github.ref == 'refs/heads/v1-stable' }} | |
type=ref,event=tag # Use the tag name as a tag for tag builds | |
type=semver,pattern={{version}} # Generate semantic versioning tags for tag builds | |
type=sha,format=short,prefix=sha- # Just in case none of the above applies | |
labels: | | |
org.opencontainers.image.title=Big-AGI | |
org.opencontainers.image.description=Generative AI suite powered by state-of-the-art models | |
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} | |
org.opencontainers.image.documentation=https://big-agi.com | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build-args: | | |
NEXT_PUBLIC_GA4_MEASUREMENT_ID=${{ secrets.GA4_MEASUREMENT_ID }} | |
# Enable build cache (future) | |
#cache-from: type=gha | |
#cache-to: type=gha,mode=max | |
# Enable provenance and SBOM (future) | |
#provenance: true | |
#sbom: true |