mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge branch 'staging' into neo-server
This commit is contained in:
29
.github/workflows/docker-publish.yml
vendored
29
.github/workflows/docker-publish.yml
vendored
@ -9,10 +9,14 @@ on:
|
||||
schedule:
|
||||
# Build the staging image everyday at 00:00 UTC
|
||||
- cron: "0 0 * * *"
|
||||
push:
|
||||
# Temporary workaround
|
||||
branches:
|
||||
- release
|
||||
|
||||
env:
|
||||
# This should allow creation of docker images even in forked repositories
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
REPO: ${{ github.repository }}
|
||||
REGISTRY: ghcr.io
|
||||
|
||||
jobs:
|
||||
@ -20,21 +24,34 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# Workaround for GitHub repo names containing uppercase characters
|
||||
- name: Set lowercase repo name
|
||||
run: |
|
||||
echo "IMAGE_NAME=${REPO,,}" >> ${GITHUB_ENV}
|
||||
|
||||
# Using the following workaround because currently GitHub Actions
|
||||
# does not support logical AND/OR operations on triggers
|
||||
# It's currently not possible to have `branches` under the `schedule` trigger
|
||||
- name: Checkout the release branch
|
||||
if: ${{ github.event_name == 'release' }}
|
||||
uses: actions/checkout@v3
|
||||
- name: Checkout the release branch (on release)
|
||||
if: ${{ github.event_name == 'release' || github.event_name == 'push' }}
|
||||
uses: actions/checkout@v4.1.2
|
||||
with:
|
||||
ref: "release"
|
||||
|
||||
- name: Checkout the staging branch
|
||||
if: ${{ github.event_name == 'schedule' }}
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4.1.2
|
||||
with:
|
||||
ref: "staging"
|
||||
|
||||
# Get current branch name
|
||||
# This is also part of the workaround for Actions not allowing logical
|
||||
# AND/OR operators on triggers
|
||||
# Otherwise the action triggered by schedule always has ref_name = release
|
||||
- name: Get the current branch name
|
||||
run: |
|
||||
echo "BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)" >> ${GITHUB_ENV}
|
||||
|
||||
# Setting up QEMU for multi-arch image build
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
@ -47,7 +64,7 @@ jobs:
|
||||
id: metadata
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
tags: ${{ github.ref_name }}
|
||||
tags: ${{ env.BRANCH_NAME }}
|
||||
|
||||
# Login into package repository as the person who created the release
|
||||
- name: Log in to the Container registry
|
||||
|
@ -684,14 +684,16 @@ drawthings.post('/generate', jsonParser, async (request, response) => {
|
||||
url.pathname = '/sdapi/v1/txt2img';
|
||||
|
||||
const body = { ...request.body };
|
||||
const auth = getBasicAuthHeader(request.body.auth);
|
||||
delete body.url;
|
||||
delete body.auth;
|
||||
|
||||
const result = await fetch(url, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(body),
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': getBasicAuthHeader(request.body.auth),
|
||||
'Authorization': auth,
|
||||
},
|
||||
timeout: 0,
|
||||
});
|
||||
|
Reference in New Issue
Block a user