diff --git a/.github/workflows/hf-cli-push-quay.yml b/.github/workflows/hf-cli-push-quay.yml new file mode 100644 index 0000000..ecd5efa --- /dev/null +++ b/.github/workflows/hf-cli-push-quay.yml @@ -0,0 +1,44 @@ +name: hf-cli-push-quay + +run-name: Build and Push HF CLI Container image to Quay.io๐Ÿš€ + +env: + IMAGE_BASE_NAME: "quay.io/alopezme/hf-cli" + + +# This section ensures that new pushes cancel current executions of the workflow +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + +on: + # schedule: + # - cron: '0 10 * * *' + push: + paths: + - 'dockerfiles/**' + - '.github/workflows/hf-cli-push-quay.yml' + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + name: "Build AWS-OC Image" + steps: + + - name: Checkout the code + uses: actions/checkout@v4 + + - name: Login to Quay.io + uses: docker/login-action@v3 + with: + registry: quay.io + username: ${{ secrets.QUAY_REPO_USERNAME }} + password: ${{ secrets.QUAY_REPO_TOKEN }} + + - name: Build and push image + uses: docker/build-push-action@v6 + with: + push: true + context: . + file: dockerfile-aws/Dockerfile + tags: ${{ env.IMAGE_BASE_NAME }}:latest diff --git a/dockerfiles/hf-cli/Dockerfile b/dockerfiles/hf-cli/Dockerfile new file mode 100644 index 0000000..7586b03 --- /dev/null +++ b/dockerfiles/hf-cli/Dockerfile @@ -0,0 +1,15 @@ +FROM registry.access.redhat.com/ubi9-minimal:latest + +# Install dependencies +RUN microdnf install -y unzip pip \ + && microdnf clean all + +# Install huggingface hub cli without cache directory +RUN pip install --no-cache-dir -U "huggingface_hub[cli]" && \ + rm -rf /root/.cache + +# Install AWS CLI +RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \ + && unzip awscliv2.zip \ + && rm -rf awscliv2.zip \ + && ./aws/install