From 7dd90bb03257e0061e74197e31de57a9e961a46b Mon Sep 17 00:00:00 2001 From: Karl Date: Sat, 17 May 2025 10:50:15 +0100 Subject: [PATCH] Initial commit --- .bumpversion.toml | 10 +++++ .github/workflows/docker-publish.yml | 50 ++++++++++++++---------- __version__.py | 1 + d | 55 +++++++++++++++++++++++++++ requirements.txt | Bin 202 -> 236 bytes 5 files changed, 95 insertions(+), 21 deletions(-) create mode 100644 .bumpversion.toml create mode 100644 __version__.py create mode 100644 d diff --git a/.bumpversion.toml b/.bumpversion.toml new file mode 100644 index 0000000..5b1737d --- /dev/null +++ b/.bumpversion.toml @@ -0,0 +1,10 @@ +[bumpversion] +current_version = "0.1.0" +commit = true +tag = true +tag_name = "{new_version}" + +[[file]] +filename = "__version__.py" +parse = '__version__\s*=\s*"(?P.*)"' +serialize = '__version__ = "{new_version}"' diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 22c4a51..3850ee3 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -1,47 +1,55 @@ -name: Build and Publish Docker Image +name: Build, Update Version and Publish Docker Image on: push: branches: [main] - tags: ['*'] # triggers on any tag push + tags: ['*'] workflow_dispatch: jobs: build-and-push: runs-on: ubuntu-latest - steps: - name: Checkout repository uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Install bump2version + run: pip install bump2version + + # Bump patch version, commit, and push back to repo (only on main branch) + - name: Bump version and push + if: github.ref == 'refs/heads/main' + run: | + bump2version patch --allow-dirty + git push origin main --follow-tags + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Log in to Docker Registry run: echo "${{ secrets.PASSWORD }}" | docker login ${{ secrets.REGISTRY }} -u "${{ secrets.USERNAME }}" --password-stdin + - name: Get version from file + id: get_version + run: | + VERSION=$(python -c "import myproject.__version__ as v; print(v.__version__)") + echo "version=$VERSION" >> $GITHUB_OUTPUT + - name: Build and Push Docker Images run: | IMAGE_NAME="ai-frame-image-server" REGISTRY="${{ secrets.REGISTRY }}" USERNAME="${{ secrets.USERNAME }}" - IMAGE_LATEST="$REGISTRY/$USERNAME/$IMAGE_NAME:latest" + VERSION="${{ steps.get_version.outputs.version }}" + IMAGE_TAG="$REGISTRY/$USERNAME/$IMAGE_NAME:$VERSION" - # Always build and tag as latest - echo "🔧 Building $IMAGE_LATEST" - docker build -t $IMAGE_LATEST . + echo "🔧 Building $IMAGE_TAG" + docker build -t $IMAGE_TAG . - echo "📤 Pushing $IMAGE_LATEST" - docker push $IMAGE_LATEST - - # If this is a tag push, tag the image accordingly - if [[ "${GITHUB_REF}" == refs/tags/* ]]; then - GIT_TAG="${GITHUB_REF#refs/tags/}" - IMAGE_TAGGED="$REGISTRY/$USERNAME/$IMAGE_NAME:$GIT_TAG" - - echo "🏷️ Also tagging as $IMAGE_TAGGED" - docker tag $IMAGE_LATEST $IMAGE_TAGGED - - echo "📤 Pushing $IMAGE_TAGGED" - docker push $IMAGE_TAGGED - fi + echo "📤 Pushing $IMAGE_TAG" + docker push $IMAGE_TAG diff --git a/__version__.py b/__version__.py new file mode 100644 index 0000000..a68927d --- /dev/null +++ b/__version__.py @@ -0,0 +1 @@ +__version__ = "0.1.0" \ No newline at end of file diff --git a/d b/d new file mode 100644 index 0000000..e345118 --- /dev/null +++ b/d @@ -0,0 +1,55 @@ +b0bb465 (HEAD -> main, tag: 0.1.0) add style for mobile +4ec98eb working lazyloading +c3f0a70 working lightbox navifation with js cache for details +636148b only load details when loading image in lightbox +cf9f5d0 cleanup and show modle name on gallery +ab1c0c3 (origin/main) fix SDXL workflow +8be2111 image queued page +0ccebcf add back button to the bottom of the gallery +da37913 add create_image page +aef0afe wrong key name +e88d490 fix the random model logic +ee18289 yaml not sh +1a3e657 test commit to see if the workflow works +26d9f38 updated workflow +2c5dbdb try create workflow to auto publish new container +e43ab87 replace image.png thumbnail +073cc3b update flux logic +41fd144 re working into libs, and use thumbs in gallery +020c2c2 updated styling and prompt on home page +4acf28e update path for flux +9aea4e6 fix sorting and sdxl workflow prompt text +81140d7 updated logic to show prompt on the lightbox display +cce1cb2 lazy load images +dcc6f94 re-add topic logic +b93d070 update gitignore +7c4ec9e Ignore publish.sh +3e974d5 fixed logic +eb59cfa wrong key +b92366f spelling mistake +60be7c4 randomly select dev/schnell when using flux +ab50f2a add publish script +c4b9dd2 last 7 prompts not 7 days +30d25d1 rework to single flow +a180a7b working flux and sdxl +2bbb2fe allow flux workflow +6fdfb51 support multiple models and random selection +e4428b4 return generated prompt, allow job to be cancelled +91c48b5 fix double running job +d32e903 retry logic, create endpoint now non blocking +42c8a2b sort gallery by new-old, move to -slim docker image +5ab4d76 strange indent +db9b961 formatting and docstrings +dcc0cdc move gallery to /images +0838f37 bigger gallery +342416a arrow cycle +6cc30bd add /gallery to show all generated images +290c1ba support auto image regeneration at specific time +d97ef3f add support for multiple models and posting a prompt to /create +0e471d7 update negative prompt +1fba2da docker compose file +8064c90 user config controls reload interval +4fd857c fill as much as possible +26e8d90 add flask to requirements +fc0b1f3 update with docker server +6ada0bf initial commit diff --git a/requirements.txt b/requirements.txt index f6e25ceaa3238995e2647296f367bdf6d7a5f6a6..ffcaa4ef6e1b4510b9da5c8d8ea75abfa2db79a5 100644 GIT binary patch delta 41 tcmX@b_=a)9DJ5P8E`}tAQifcH0tQ_mSqUV|7*ZLE7>XG(8S)wO7y#RK2}S?_ delta 6 NcmaFEc#3htDF6zn0}}uM