feat: Enhanced deployment to use keycloak operator and dual auth modes #255
Workflow file for this run
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: CI/CD Pipeline | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| env: | |
| REGISTRY: quay.io | |
| REPOSITORY: rh-ai-quickstart | |
| PROJECT_NAME: spending-monitor | |
| jobs: | |
| semantic-release: | |
| # Skip running on forked repositories | |
| if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name != 'pull_request' | |
| runs-on: ubuntu-latest | |
| outputs: | |
| new_release_tag: ${{ steps.get-tag.outputs.tag }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.TOKEN }} | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install semantic-release dependencies | |
| run: | | |
| npm install -g semantic-release @semantic-release/changelog @semantic-release/commit-analyzer @semantic-release/release-notes-generator @semantic-release/github | |
| - name: Run semantic-release | |
| id: semantic | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.TOKEN }} | |
| run: semantic-release | |
| - name: Get latest tag | |
| id: get-tag | |
| run: | | |
| TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "") | |
| echo "tag=$TAG" >> $GITHUB_OUTPUT | |
| build-and-push: | |
| needs: semantic-release | |
| # This job only runs if a new release tag was created by semantic-release | |
| if: needs.semantic-release.outputs.new_release_tag != '' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| package: [ui, api, db] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Quay.io | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ secrets.QUAY_USERNAME }} | |
| password: ${{ secrets.QUAY_PASSWORD }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./packages/${{ matrix.package }}/Containerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: | | |
| ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/${{ env.PROJECT_NAME }}-${{ matrix.package }}:${{ needs.semantic-release.outputs.new_release_tag }} | |
| ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/${{ env.PROJECT_NAME }}-${{ matrix.package }}:latest | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| build-args: | | |
| TORCH_VARIANT=cuda |