Initial commit for ComfyUI Runpod worker #60
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: Docker Build and Push Container | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# TODO: Enable this step if not using network volume | |
# - name: Free disk space | |
# run: | | |
# df -h | |
# sudo rm -rf /usr/share/dotnet | |
# sudo rm -rf /usr/local/lib/android | |
# sudo rm -rf /opt/ghc | |
# sudo rm -rf /opt/hostedtoolcache | |
# df -h | |
- uses: actions/checkout@v3 | |
with: | |
ref: main | |
- name: Generate version number | |
id: version | |
run: | | |
echo "VERSION=v1.0.${{ github.run_number }}" >> $GITHUB_OUTPUT | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
driver: docker-container | |
buildkitd-flags: --debug | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build container and push to Docker Hub | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: true | |
tags: | | |
${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO_NAME }}:latest | |
${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO_NAME }}:${{ steps.version.outputs.VERSION }} | |
cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO_NAME }}:buildcache | |
cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO_NAME }}:buildcache,mode=max | |
platforms: linux/amd64 |