Start implementation of using a volume for model cache #41
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: Build Main | |
| on: | |
| push: | |
| branches: [ main, ghactions ] | |
| jobs: | |
| build-main: | |
| name: Build and push a main snapshot image | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-go@v4 | |
| with: | |
| go-version-file: go.mod | |
| id: go | |
| - name: Set Env Tags | |
| run: | | |
| echo RELEASE_TAG=0.0.0-${GITHUB_REF#refs/heads/} >> $GITHUB_ENV | |
| echo BRANCH_TAG=${GITHUB_REF#refs/heads/} >> $GITHUB_ENV | |
| - name: Set image registry env | |
| run: | | |
| echo IMAGE_REGISTRY=$(echo ${{ secrets.IMAGE_REGISTRY }} | cut -d '/' -f 1) >> $GITHUB_ENV | |
| echo IMAGE_REPO=$(echo ${{ secrets.IMAGE_REGISTRY }} | cut -d '/' -f 2) >> $GITHUB_ENV | |
| - name: Build Operator Image | |
| id: build-operator-image | |
| uses: redhat-actions/buildah-build@v2 | |
| with: | |
| image: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_REPO }}/docling-operator | |
| tags: ${{ github.sha }} ${{ env.RELEASE_TAG }} ${{ env.BRANCH_TAG }} | |
| build-args: | | |
| quay_expiration=1w | |
| release_tag=${{ env.RELEASE_TAG }} | |
| dockerfiles: | | |
| ./Dockerfile | |
| - name: Push Operator Image | |
| id: push-operator-image | |
| uses: redhat-actions/push-to-registry@v2 | |
| with: | |
| image: docling-operator | |
| tags: ${{ steps.build-operator-image.outputs.tags }} | |
| registry: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_REPO }} | |
| username: ${{ secrets.REGISTRY_USER }} | |
| password: ${{ secrets.REGISTRY_PASSWORD }} | |
| - name: Build Bundle | |
| id: build-bundle | |
| run: | | |
| IMAGE_REGISTRY=${{ env.IMAGE_REGISTRY }} \ | |
| IMAGE_REPO=${{ env.IMAGE_REPO }} \ | |
| RELEASE_TAG=${{ env.RELEASE_TAG }} \ | |
| VERSION=${{ env.RELEASE_TAG }} \ | |
| make bundle | |
| - name: Build Bundle Image | |
| id: build-bundle-image | |
| uses: redhat-actions/buildah-build@v2 | |
| with: | |
| image: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_REPO }}/docling-operator-bundle | |
| tags: ${{ env.RELEASE_TAG }} ${{ env.BRANCH_TAG }} | |
| dockerfiles: | | |
| ./bundle.Dockerfile | |
| - name: Push Bundle Image | |
| id: push-bundle-image | |
| uses: redhat-actions/push-to-registry@v2 | |
| with: | |
| image: docling-operator-bundle | |
| tags: ${{ steps.build-bundle-image.outputs.tags }} | |
| registry: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_REPO }} | |
| username: ${{ secrets.REGISTRY_USER }} | |
| password: ${{ secrets.REGISTRY_PASSWORD }} | |
| - run: echo "Operator Image pushed to ${{ steps.push-operator-image.outputs.registry-paths }}" | |
| - run: echo "Bundle Image pushed to ${{ steps.push-bundle-image.outputs.registry-paths }}" |