Release version (#470) #1
This file contains hidden or 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: latent-to-image-docker-cd | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "docker_images/latent-to-image/**" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: "3.8" | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v1 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v1 | |
| - name: Install dependencies | |
| run: | | |
| pip install --upgrade pip | |
| pip install awscli | |
| - uses: huggingface/tailscale-action@v1 | |
| with: | |
| authkey: ${{ secrets.TAILSCALE_AUTHKEY }} | |
| - name: Update upstream | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} | |
| DEFAULT_HOSTNAME: ${{ secrets.DEFAULT_HOSTNAME }} | |
| REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }} | |
| REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} | |
| run: | | |
| python build_docker.py latent-to-image --out out.txt | |
| - name: Deploy on API | |
| run: | | |
| # Load the tags into the env | |
| cat out.txt >> $GITHUB_ENV | |
| export $(xargs < out.txt) | |
| echo ${LATENT_TO_IMAGE_CPU_TAG} | |
| # Weird single quote escape mechanism because string interpolation does | |
| # not work on single quote in bash | |
| curl -H "Authorization: Bearer ${{ secrets.API_GITHUB_TOKEN }}" https://api.github.com/repos/huggingface/api-inference/actions/workflows/update_community.yaml/dispatches -d '{"ref":"main","inputs":{"framework":"LATENT_TO_IMAGE","tag": "'"${LATENT_TO_IMAGE_CPU_TAG}"'"}}' | |