CD: build & push image #4
Workflow file for this run
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
name: "CD: build & push image" | ||
on: | ||
push: | ||
branches: | ||
- 'init' | ||
env: | ||
PYTHON_DEFAULT_VERSION: "3.12" | ||
# on: | ||
# workflow_dispatch: | ||
env: | ||
TAG_VERSION: "v0-latest" | ||
DOCKER_REPO_NAME: "backenddevelopersltd/compute-horde-prompt-gen" | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_DEFAULT_VERSION }} | ||
- name: Install dependencies | ||
run: python -m pip install --upgrade 'pdm>=2.12,<3' | ||
- name: Docker build and push | ||
run: | | ||
IMAGE_NAME="${DOCKER_REPO_NAME}:${TAG_VERSION}" | ||
echo "${{ secrets.DOCKERHUB_KEY }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin | ||
ls | ||
echo "-----" | ||
pdm install | ||
echo "-----" | ||
python3 download_model.py --huggingface_token "${{ secrets.HUGGINGFACE_API_KEY }}" | ||
echo "-----" | ||
cd src/compute_horde_prompt_gen | ||
ls | ||
echo "-----" | ||
docker build -t "${{ secrets.HUGGINGFACE_API_KEY }}" -horde-prompt-gen . | ||
docker run -v ./output/:/app/output/ "${{ secrets.HUGGINGFACE_API_KEY }}" --number_of_batches 5 --number_of_prompts_per_batch 30 --uuids uuid1,uuid2,uuid3,uuid4,uuid5 |