feat: use human-friendly URLs for vibe pages #23
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
| # ============================================================================= | |
| # Vibeyard - Build and Deploy to Kubernetes | |
| # ============================================================================= | |
| # Builds Docker images for app, migrator, and worker, then deploys to EKS | |
| # ============================================================================= | |
| name: deploy-vibeyard | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| build-and-deploy: | |
| environment: prod | |
| runs-on: ubuntu-latest | |
| env: | |
| HELM_FILE: deploy/prod/values.yaml | |
| WORKER_HELM_FILE: deploy/prod/worker-values.yaml | |
| REGION: us-east-1 | |
| CLUSTER_NAME: maker-prod | |
| NAMESPACE: vibeyard | |
| SERVICE_NAME: vibeyard | |
| AWS_ECR_NAME: vibeyard-prod | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: ${{ env.REGION }} | |
| - name: Login to AWS ECR | |
| id: login-ecr | |
| uses: aws-actions/amazon-ecr-login@v2 | |
| - name: Set up Docker Buildx | |
| if: ${{ !contains(github.event.head_commit.message, '[skip build]') }} | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Extract commit hash | |
| id: vars | |
| if: ${{ !contains(github.event.head_commit.message, '[skip build]') }} | |
| shell: bash | |
| run: | | |
| echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
| - name: Build and push app image | |
| id: build-app | |
| if: ${{ !contains(github.event.head_commit.message, '[skip build]') }} | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| target: runner | |
| push: true | |
| tags: | | |
| ${{ steps.login-ecr.outputs.registry }}/${{ env.AWS_ECR_NAME }}:app-${{ steps.vars.outputs.sha_short }} | |
| ${{ steps.login-ecr.outputs.registry }}/${{ env.AWS_ECR_NAME }}:app-latest | |
| cache-from: type=registry,ref=${{ steps.login-ecr.outputs.registry }}/${{ env.AWS_ECR_NAME }}:cache-app | |
| cache-to: type=registry,ref=${{ steps.login-ecr.outputs.registry }}/${{ env.AWS_ECR_NAME }}:cache-app,mode=max | |
| - name: Build and push migrator image | |
| id: build-migrator | |
| if: ${{ !contains(github.event.head_commit.message, '[skip build]') }} | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| target: migrator | |
| push: true | |
| tags: | | |
| ${{ steps.login-ecr.outputs.registry }}/${{ env.AWS_ECR_NAME }}:migrator-${{ steps.vars.outputs.sha_short }} | |
| ${{ steps.login-ecr.outputs.registry }}/${{ env.AWS_ECR_NAME }}:migrator-latest | |
| cache-from: type=registry,ref=${{ steps.login-ecr.outputs.registry }}/${{ env.AWS_ECR_NAME }}:cache-app | |
| - name: Build and push worker image | |
| id: build-worker | |
| if: ${{ !contains(github.event.head_commit.message, '[skip build]') }} | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| target: worker | |
| push: true | |
| tags: | | |
| ${{ steps.login-ecr.outputs.registry }}/${{ env.AWS_ECR_NAME }}:worker-${{ steps.vars.outputs.sha_short }} | |
| ${{ steps.login-ecr.outputs.registry }}/${{ env.AWS_ECR_NAME }}:worker-latest | |
| cache-from: type=registry,ref=${{ steps.login-ecr.outputs.registry }}/${{ env.AWS_ECR_NAME }}:cache-app | |
| - name: Replace variables in Helm values files | |
| if: ${{ !contains(github.event.head_commit.message, '[skip deploy]') }} | |
| env: | |
| ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | |
| IMAGE_TAG: ${{ steps.vars.outputs.sha_short }} | |
| run: | | |
| sed -i 's|${ECR_REGISTRY}|'"$ECR_REGISTRY"'|g' $HELM_FILE | |
| sed -i 's|${IMAGE_TAG}|'"$IMAGE_TAG"'|g' $HELM_FILE | |
| sed -i 's|${ECR_REGISTRY}|'"$ECR_REGISTRY"'|g' $WORKER_HELM_FILE | |
| sed -i 's|${IMAGE_TAG}|'"$IMAGE_TAG"'|g' $WORKER_HELM_FILE | |
| - name: Configure kubectl | |
| if: ${{ !contains(github.event.head_commit.message, '[skip deploy]') }} | |
| run: | | |
| aws eks update-kubeconfig --name ${{ env.CLUSTER_NAME }} --region ${{ env.REGION }} | |
| - name: Deploy main app to Kubernetes | |
| id: deploy-app | |
| if: ${{ !contains(github.event.head_commit.message, '[skip deploy]') }} | |
| uses: bitovi/github-actions-deploy-eks-helm@v1.2.10 | |
| with: | |
| cluster-name: ${{ env.CLUSTER_NAME }} | |
| config-files: ${{ env.HELM_FILE }} | |
| chart-path: techops-services/common | |
| namespace: ${{ env.NAMESPACE }} | |
| timeout: 5m0s | |
| name: ${{ env.SERVICE_NAME }} | |
| chart-repository: https://techops-services.github.io/helm-charts | |
| version: 0.0.33 | |
| atomic: true | |
| - name: Deploy worker to Kubernetes | |
| id: deploy-worker | |
| if: ${{ !contains(github.event.head_commit.message, '[skip deploy]') }} | |
| uses: bitovi/github-actions-deploy-eks-helm@v1.2.10 | |
| with: | |
| cluster-name: ${{ env.CLUSTER_NAME }} | |
| config-files: ${{ env.WORKER_HELM_FILE }} | |
| chart-path: techops-services/common | |
| namespace: ${{ env.NAMESPACE }} | |
| timeout: 5m0s | |
| name: ${{ env.SERVICE_NAME }}-worker | |
| chart-repository: https://techops-services.github.io/helm-charts | |
| version: 0.0.33 | |
| atomic: true |