ci: enables docker builds for nightly tags (#3719)
This commit is contained in:
parent
ce11df2a94
commit
7f6b3873ee
3 changed files with 59 additions and 20 deletions
69
.github/workflows/docker-build.yml
vendored
69
.github/workflows/docker-build.yml
vendored
|
|
@ -12,10 +12,17 @@ on:
|
||||||
required: false
|
required: false
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
nightly_build:
|
nightly_tag_main:
|
||||||
|
description: "Tag for the nightly main build"
|
||||||
required: false
|
required: false
|
||||||
type: boolean
|
type: string
|
||||||
default: false
|
default: ''
|
||||||
|
nightly_tag_base:
|
||||||
|
description: "Tag for the nightly base build"
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: ''
|
||||||
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
version:
|
||||||
|
|
@ -31,11 +38,16 @@ on:
|
||||||
required: false
|
required: false
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
nightly_build:
|
nightly_tag_main:
|
||||||
description: "Build nightly build"
|
description: "Tag for the nightly main build"
|
||||||
required: false
|
required: false
|
||||||
type: boolean
|
type: string
|
||||||
default: false
|
default: ''
|
||||||
|
nightly_tag_base:
|
||||||
|
description: "Tag for the nightly base build"
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: ''
|
||||||
|
|
||||||
env:
|
env:
|
||||||
POETRY_VERSION: "1.8.2"
|
POETRY_VERSION: "1.8.2"
|
||||||
|
|
@ -45,11 +57,25 @@ jobs:
|
||||||
get-version:
|
get-version:
|
||||||
name: Get Version
|
name: Get Version
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
version: ${{ steps.get-version-input.outputs.version || steps.get-version-base.outputs.version || steps.get-version-main.outputs.version }}
|
version: ${{ steps.get-version-input.outputs.version || steps.get-version-base.outputs.version || steps.get-version-main.outputs.version }}
|
||||||
|
nightly-tag: ${{ steps.resolve-nightly-tag.outputs.nightly_tag }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Resolve nightly tag
|
||||||
|
id: resolve-nightly-tag
|
||||||
|
run: |
|
||||||
|
if [[ "${{ inputs.nightly_tag_main }}" != '' ]]; then
|
||||||
|
echo "nightly_tag=${{ inputs.nightly_tag_main }}" >> $GITHUB_OUTPUT
|
||||||
|
elif [[ "${{ inputs.nightly_tag_base }}" != '' ]]; then
|
||||||
|
echo "nightly_tag=${{ inputs.nightly_tag_base }}" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "nightly_tag=" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Check out the code at a specific ref (e.g., nightly tag)
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ steps.resolve-nightly-tag.outputs.nightly_tag || github.ref }}
|
||||||
- name: Set up Python 3.12 + Poetry ${{ env.POETRY_VERSION }}
|
- name: Set up Python 3.12 + Poetry ${{ env.POETRY_VERSION }}
|
||||||
uses: "./.github/actions/poetry_caching"
|
uses: "./.github/actions/poetry_caching"
|
||||||
with:
|
with:
|
||||||
|
|
@ -80,13 +106,19 @@ jobs:
|
||||||
outputs:
|
outputs:
|
||||||
tags: ${{ steps.set-vars.outputs.tags }}
|
tags: ${{ steps.set-vars.outputs.tags }}
|
||||||
file: ${{ steps.set-vars.outputs.file }}
|
file: ${{ steps.set-vars.outputs.file }}
|
||||||
|
env:
|
||||||
|
NIGHTLY_TAG: ${{ needs.get-version.outputs.nightly-tag }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Check out the code at a specific ref (e.g., nightly tag)
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ env.NIGHTLY_TAG || github.ref }}
|
||||||
|
|
||||||
- name: Set Dockerfile and Tags
|
- name: Set Dockerfile and Tags
|
||||||
id: set-vars
|
id: set-vars
|
||||||
run: |
|
run: |
|
||||||
nightly_suffix=""
|
nightly_suffix=''
|
||||||
if [[ "${{ inputs.nightly_build }}" == "true" ]]; then
|
if [[ "${{ env.NIGHTLY_TAG }}" != '' ]]; then
|
||||||
nightly_suffix="-nightly"
|
nightly_suffix="-nightly"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -103,9 +135,12 @@ jobs:
|
||||||
fi
|
fi
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: setup
|
needs: [get-version, setup]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Check out the code at a specific ref (e.g., nightly tag)
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ needs.get-version.outputs.nightly-tag || github.ref }}
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
|
|
@ -138,7 +173,11 @@ jobs:
|
||||||
dockerfile: ./docker/frontend/build_and_push_frontend.Dockerfile
|
dockerfile: ./docker/frontend/build_and_push_frontend.Dockerfile
|
||||||
tags: ${{ inputs.pre_release == 'true' && format('langflowai/langflow-frontend{0}:{1}', inputs.nightly_build && '-nightly' || '', needs.get-version.outputs.version) || format('langflowai/langflow-frontend{0}:{1},langflowai/langflow-frontend{0}:latest{1}', inputs.nightly_build && '-nightly' || '', needs.get-version.outputs.version) }}
|
tags: ${{ inputs.pre_release == 'true' && format('langflowai/langflow-frontend{0}:{1}', inputs.nightly_build && '-nightly' || '', needs.get-version.outputs.version) || format('langflowai/langflow-frontend{0}:{1},langflowai/langflow-frontend{0}:latest{1}', inputs.nightly_build && '-nightly' || '', needs.get-version.outputs.version) }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Check out the code at a specific ref (e.g., nightly tag)
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ needs.get-version.outputs.nightly-tag || github.ref }}
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
|
|
|
||||||
4
.github/workflows/nightly_build.yml
vendored
4
.github/workflows/nightly_build.yml
vendored
|
|
@ -104,8 +104,8 @@ jobs:
|
||||||
needs: [frontend-tests, backend-unit-tests, create-nightly-tag]
|
needs: [frontend-tests, backend-unit-tests, create-nightly-tag]
|
||||||
uses: ./.github/workflows/release_nightly.yml
|
uses: ./.github/workflows/release_nightly.yml
|
||||||
with:
|
with:
|
||||||
build_docker_base: false # TODO: Docker builds
|
build_docker_base: true
|
||||||
build_docker_main: false
|
build_docker_main: true
|
||||||
nightly_tag_main: ${{ needs.create-nightly-tag.outputs.main_tag }}
|
nightly_tag_main: ${{ needs.create-nightly-tag.outputs.main_tag }}
|
||||||
nightly_tag_base: ${{ needs.create-nightly-tag.outputs.base_tag }}
|
nightly_tag_base: ${{ needs.create-nightly-tag.outputs.base_tag }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
|
||||||
4
.github/workflows/release_nightly.yml
vendored
4
.github/workflows/release_nightly.yml
vendored
|
|
@ -204,7 +204,7 @@ jobs:
|
||||||
# version should be needs.release-main.outputs.version if release_type is main
|
# version should be needs.release-main.outputs.version if release_type is main
|
||||||
version: ""
|
version: ""
|
||||||
release_type: ${{ matrix.release_type }}
|
release_type: ${{ matrix.release_type }}
|
||||||
nightly_build: true
|
nightly_tag_base: ${{ inputs.nightly_tag_base }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
call_docker_build_main:
|
call_docker_build_main:
|
||||||
|
|
@ -221,5 +221,5 @@ jobs:
|
||||||
# version should be needs.release-main.outputs.version if release_type is main
|
# version should be needs.release-main.outputs.version if release_type is main
|
||||||
version: ""
|
version: ""
|
||||||
release_type: ${{ matrix.release_type }}
|
release_type: ${{ matrix.release_type }}
|
||||||
nightly_build: true
|
nightly_tag_main: ${{ inputs.nightly_tag_main }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue