diff --git a/.github/workflows/chatbot.yaml b/.github/workflows/chatbot.yaml index 23ed2a473..e2bfb7542 100644 --- a/.github/workflows/chatbot.yaml +++ b/.github/workflows/chatbot.yaml @@ -32,14 +32,8 @@ jobs: steps: - uses: actions/checkout@v4.1.1 - - name: Login to ghcr - uses: docker/login-action@v3.1.0 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Buildah Action + - name: Build Image + id: build_image uses: redhat-actions/buildah-build@v2.13 with: image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} @@ -57,3 +51,24 @@ jobs: - name: Run tests working-directory: ./recipes/natural_language_processing/chatbot run: make test + + - name: Login to container registry + if: > + (github.event_name == 'push' || github.event_name == 'schedule') && + (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) + uses: docker/login-action@v3.1.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Push model-service image + id: push_model_service + if: > + (github.event_name == 'push' || github.event_name == 'schedule') && + (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) + uses: redhat-actions/push-to-registry@v2.8 + with: + image: ${{ steps.build_image.outputs.image }} + tags: ${{ steps.build_image.outputs.tags }} + registry: ${{ env.REGISTRY }} diff --git a/.github/workflows/model_servers.yaml b/.github/workflows/model_servers.yaml index 76381c16f..27fb69ad8 100644 --- a/.github/workflows/model_servers.yaml +++ b/.github/workflows/model_servers.yaml @@ -32,14 +32,8 @@ jobs: steps: - uses: actions/checkout@v4.1.1 - - name: Login to ghcr - uses: docker/login-action@v3.1.0 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Buildah Action + - name: Build Image + id: build_image uses: redhat-actions/buildah-build@v2.13 with: image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} @@ -61,3 +55,24 @@ jobs: - name: Run tests working-directory: ./model_servers/llamacpp_python/ run: make test + + - name: Login to container registry + if: > + (github.event_name == 'push' || github.event_name == 'schedule') && + (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) + uses: docker/login-action@v3.1.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Push model-service image + id: push_model_service + if: > + (github.event_name == 'push' || github.event_name == 'schedule') && + (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) + uses: redhat-actions/push-to-registry@v2.8 + with: + image: ${{ steps.build_image.outputs.image }} + tags: ${{ steps.build_image.outputs.tags }} + registry: ${{ env.REGISTRY }}