Update mcp server #76
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 and Push Docker Image | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| - update-mcp-server | |
| tags: | |
| - 'test' | |
| pull_request: | |
| branches: | |
| - main | |
| - master | |
| - update-mcp-server | |
| workflow_dispatch: | |
| env: | |
| IMAGE_NAME: bankofai/docs | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Debug Docker Hub secrets | |
| if: github.event_name != 'pull_request' | |
| env: | |
| DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
| DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | |
| run: | | |
| echo "username=[$DOCKERHUB_USERNAME]" | |
| echo "token_length=${#DOCKERHUB_TOKEN}" | |
| - name: Log in to Docker Hub | |
| if: github.event_name != 'pull_request' | |
| env: | |
| DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
| DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | |
| run: | | |
| echo "$DOCKERHUB_TOKEN" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin | |
| - name: Extract Docker metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=raw,value=test | |
| - name: Determine APP_ENV | |
| id: app_env | |
| run: | | |
| if [[ "${{ github.ref }}" == "refs/heads/main" || "${{ github.ref }}" == "refs/heads/master" ]]; then | |
| echo "APP_ENV=production" >> $GITHUB_OUTPUT | |
| elif [[ "${{ github.ref }}" == refs/tags/* ]]; then | |
| echo "APP_ENV=production" >> $GITHUB_OUTPUT | |
| else | |
| echo "APP_ENV=development" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| build-args: | | |
| APP_ENV=${{ steps.app_env.outputs.APP_ENV }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| platforms: linux/amd64 |