Skip to content

Commit

Permalink
feat(gh-action): Build image text-generation webui
Browse files Browse the repository at this point in the history
  • Loading branch information
marchuk-vlad committed Sep 25, 2024
1 parent 3d1031e commit c9017ba
Showing 1 changed file with 68 additions and 2 deletions.
70 changes: 68 additions & 2 deletions .github/workflows/text-generation-webui-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ on:
- stage
- testnet

env:
IMAGE_FILE: ''
IMAGE_RESOURCE: ''
SOLUTION: text-generation-webui
PR_REPO_ARGO: super-protocol/argocd-clusters
DOCKERFILE: "Text\ Generation\ WebUI/Dockerfile"
DOCKER_CONTEXT: "./Text\ Generation\ WebUI/"
TARGET: ${{ inputs.target }}

jobs:
build-text-genration-webui:
runs-on: ubuntu-latest
Expand All @@ -22,6 +31,63 @@ jobs:
repository-projects: read

steps:
- name: Echo
- name: Checkout repository
uses: actions/checkout@v4

- name: Checkout git submodules
run: |
git submodule update
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: --debug
driver-opts: |
image=moby/buildkit:v0.12.0
- name: Build Docker image and save to file
run: |
IMAGE_FILE="$SOLUTION-image-$TARGET-b${{ github.run_id }}"
docker build -t $SOLUTION:latest -f $DOCKERFILE $DOCKER_CONTEXT
docker save $SOLUTION:latest | gzip > $IMAGE_FILE.tar.gz
echo "IMAGE_FILE=$IMAGE_FILE" >> $GITHUB_ENV
- name: Set SPCTL repository type
run: |
if [ "$TARGET" == "develop" || "$TARGET" == "stage" ]; then
SPCTL_REPOSITORY_TYPE=private
else
SPCTL_REPOSITORY_TYPE=public
fi
echo "SPCTL_REPOSITORY_TYPE=$SPCTL_REPOSITORY_TYPE" >> $GITHUB_ENV
- name: Download and install SPCTL
uses: Super-Protocol/sp-build-tools/actions/download-spctl
with:
version: latest
repository: ${{ env.SPCTL_REPOSITORY_TYPE }}
gh_token: ${{ secrets.GHFG_TOKEN_SPCTL_RELEASES_DOWNLOAD }}

- name: Prepare SPCTL config
run: |
if [ "$TARGET" == "develop" ]; then
SPCTL_CONFIG="${{ secrets.DEVELOP_OFFERS_SPCTL_CONFIG_BASE64 }}"
if [ "$TARGET" == "stage" ]; then
SPCTL_CONFIG="${{ secrets.STAGING_OFFERS_SPCTL_CONFIG_BASE64 }}"
elif [ "$TARGET" == "testnet" ]; then
SPCTL_CONFIG="${{ secrets.TESTNET_OFFERS_SPCTL_CONFIG_BASE64 }}"
fi
echo "$SPCTL_CONFIG" | base64 --decode > ./config.json
./spctl --version
- name: Encrypt and upload image
id: upload_image
run: |
echo 1
./spctl files upload $IMAGE_FILE.tar.gz --output $IMAGE_FILE.json --filename $IMAGE_FILE.tar.gz
cat $IMAGE_FILE.json
echo "IMAGE_RESOURCE=$IMAGE_FILE.json" >> $GITHUB_ENV

0 comments on commit c9017ba

Please sign in to comment.