jaseci-website-v0.2.2 #25
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: Build and Deploy Jaseci & ByLLM Websites | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| deploy-jaseci-website: | |
| if: startsWith(github.ref, 'refs/tags/jaseci-website-') || (startsWith(github.ref, 'refs/tags/v') && !startsWith(github.ref, 'refs/tags/byllm-website-')) || github.event_name == 'workflow_dispatch' | |
| runs-on: ubuntu-latest | |
| outputs: | |
| tag: ${{ steps.tag.outputs.tag }} | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| # Checkout the repository | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| # Set up QEMU for multi-architecture builds | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| # Set up Docker Buildx for multi-architecture builds | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| # Configure AWS credentials | |
| - name: Configure AWS Credentials | |
| uses: aws-actions/[email protected] | |
| with: | |
| aws-region: us-east-2 | |
| role-to-assume: arn:aws:iam::776241927220:role/GitHubActionsSharedECRRole | |
| role-session-name: GitHubActions | |
| audience: sts.amazonaws.com | |
| - name: Debug AWS Credentials | |
| run: | | |
| aws sts get-caller-identity | |
| - name: Debug OIDC Token | |
| run: | | |
| echo "OIDC_TOKEN=$ACTIONS_ID_TOKEN_REQUEST_TOKEN" | |
| curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=sts.amazonaws.com" | |
| # Login to AWS ECR | |
| - name: Login to Amazon ECR | |
| id: login-ecr | |
| uses: aws-actions/amazon-ecr-login@v2 | |
| # Extract tag name from GitHub ref | |
| - name: Get tag name | |
| id: tag | |
| run: | | |
| if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then | |
| # Manual dispatch - use timestamp | |
| TAG="manual-$(date +%Y%m%d-%H%M%S)" | |
| elif [[ "${{ github.event_name }}" == "release" ]]; then | |
| # Release event - clean tag name | |
| TAG_NAME=${GITHUB_REF#refs/tags/} | |
| # Remove prefixes: jaseci-website-v1.2.3 -> v1.2.3 or jaseci-website-1.2.3 -> 1.2.3 | |
| if [[ $TAG_NAME =~ ^jaseci-website-(.+)$ ]]; then | |
| TAG="${BASH_REMATCH[1]}" | |
| elif [[ $TAG_NAME =~ ^v(.+)$ ]]; then | |
| TAG="$TAG_NAME" | |
| else | |
| # Use tag as-is if no prefix | |
| TAG="$TAG_NAME" | |
| fi | |
| else | |
| # Fallback | |
| TAG="latest" | |
| fi | |
| echo "Tag: $TAG" | |
| echo "Event: ${{ github.event_name }}" | |
| echo "Original Tag Name: ${TAG_NAME:-N/A}" | |
| echo "tag=$TAG" >> $GITHUB_OUTPUT | |
| # Build and push Docker image | |
| - name: Build and push Docker image | |
| env: | |
| ECR_REGISTRY: 776241927220.dkr.ecr.us-east-2.amazonaws.com | |
| ECR_REPOSITORY: jaseci-website | |
| IMAGE_TAG: ${{ steps.tag.outputs.tag }} | |
| run: | | |
| echo "Building and pushing to: $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" | |
| # Build and push multi-architecture image | |
| docker buildx build \ | |
| --platform linux/amd64 \ | |
| -f jaseci-org/dockerfile \ | |
| -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG \ | |
| -t $ECR_REGISTRY/$ECR_REPOSITORY:latest \ | |
| --push \ | |
| ./jaseci-org | |
| deploy-byllm-website: | |
| if: startsWith(github.ref, 'refs/tags/byllm-website-') || github.event_name == 'workflow_dispatch' | |
| runs-on: ubuntu-latest | |
| outputs: | |
| tag: ${{ steps.tag.outputs.tag }} | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| # Checkout the repository | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| # Set up QEMU for multi-architecture builds | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| # Set up Docker Buildx for multi-architecture builds | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| # Configure AWS credentials | |
| - name: Configure AWS Credentials | |
| uses: aws-actions/[email protected] | |
| with: | |
| aws-region: us-east-2 | |
| role-to-assume: arn:aws:iam::776241927220:role/GitHubActionsSharedECRRole | |
| role-session-name: GitHubActions | |
| audience: sts.amazonaws.com | |
| - name: Debug AWS Credentials | |
| run: | | |
| aws sts get-caller-identity | |
| - name: Debug OIDC Token | |
| run: | | |
| echo "OIDC_TOKEN=$ACTIONS_ID_TOKEN_REQUEST_TOKEN" | |
| curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=sts.amazonaws.com" | |
| # Login to AWS ECR | |
| - name: Login to Amazon ECR | |
| id: login-ecr | |
| uses: aws-actions/amazon-ecr-login@v2 | |
| # Extract tag name from GitHub ref | |
| - name: Get tag name | |
| id: tag | |
| run: | | |
| if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then | |
| # Manual dispatch - use timestamp | |
| TAG="manual-$(date +%Y%m%d-%H%M%S)" | |
| elif [[ "${{ github.event_name }}" == "release" ]]; then | |
| # Release event - clean tag name | |
| TAG_NAME=${GITHUB_REF#refs/tags/} | |
| # Remove prefixes: byllm-website-v1.2.3 -> v1.2.3 or byllm-website-1.2.3 -> 1.2.3 | |
| if [[ $TAG_NAME =~ ^byllm-website-(.+)$ ]]; then | |
| TAG="${BASH_REMATCH[1]}" | |
| elif [[ $TAG_NAME =~ ^v(.+)$ ]]; then | |
| TAG="$TAG_NAME" | |
| else | |
| # Use tag as-is if no prefix | |
| TAG="$TAG_NAME" | |
| fi | |
| else | |
| # Fallback | |
| TAG="latest" | |
| fi | |
| echo "Tag: $TAG" | |
| echo "Event: ${{ github.event_name }}" | |
| echo "Original Tag Name: ${TAG_NAME:-N/A}" | |
| echo "tag=$TAG" >> $GITHUB_OUTPUT | |
| # Build and push Docker image | |
| - name: Build and push Docker image | |
| env: | |
| ECR_REGISTRY: 776241927220.dkr.ecr.us-east-2.amazonaws.com | |
| ECR_REPOSITORY: byllm-website | |
| IMAGE_TAG: ${{ steps.tag.outputs.tag }} | |
| run: | | |
| echo "Building and pushing to: $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" | |
| # Build and push multi-architecture image | |
| docker buildx build \ | |
| --platform linux/amd64 \ | |
| -f byllm/Dockerfile \ | |
| -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG \ | |
| -t $ECR_REGISTRY/$ECR_REPOSITORY:latest \ | |
| --push \ | |
| ./byllm | |
| summary: | |
| needs: [deploy-jaseci-website, deploy-byllm-website] | |
| runs-on: ubuntu-latest | |
| if: always() | |
| steps: | |
| - name: Build and Push Summary | |
| run: | | |
| echo "## Website Deployment Summary" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| # Jaseci Website Summary | |
| if [[ "${{ needs.deploy-jaseci-website.result }}" != "skipped" ]]; then | |
| echo "### Jaseci Website" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Image Tag**: ${{ needs.deploy-jaseci-website.outputs.tag }}" >> $GITHUB_STEP_SUMMARY | |
| echo "- **ECR Repository**: 776241927220.dkr.ecr.us-east-2.amazonaws.com/jaseci-website" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Status**: ${{ needs.deploy-jaseci-website.result }}" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Website URL**: https://new.jaseci.org (Blue deployment)" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Production URL**: https://jaseci.org (after DNS switch)" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| # ByLLM Website Summary | |
| if [[ "${{ needs.deploy-byllm-website.result }}" != "skipped" ]]; then | |
| echo "### ByLLM Website" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Image Tag**: ${{ needs.deploy-byllm-website.outputs.tag }}" >> $GITHUB_STEP_SUMMARY | |
| echo "- **ECR Repository**: 776241927220.dkr.ecr.us-east-2.amazonaws.com/byllm-website" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Status**: ${{ needs.deploy-byllm-website.result }}" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Production URL**: (TBD - depends on deployment configuration)" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| echo "**Note**: Deployments will be handled automatically by Flux in jaseci-cluster." >> $GITHUB_STEP_SUMMARY |