Skip to content

Commit 6bf4ea0

Browse files
committed
add deployment workflow for jac-shadcn with jac-scale
1 parent 9cbda64 commit 6bf4ea0

2 files changed

Lines changed: 81 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Deploy jac-shadcn with jac-scale
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
permissions:
9+
id-token: write
10+
contents: read
11+
12+
jobs:
13+
deploy-jac-shadcn:
14+
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/jac-shadcn-') || startsWith(github.ref, 'refs/tags/v')
15+
runs-on: ubuntu-latest
16+
17+
permissions:
18+
id-token: write
19+
contents: read
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
25+
- name: Configure AWS Credentials
26+
uses: aws-actions/configure-aws-credentials@v4.2.0
27+
with:
28+
aws-region: us-east-2
29+
role-to-assume: arn:aws:iam::776241927220:role/GitHubActionsJaseciDeployRole
30+
role-session-name: GitHubActions-JacShadcn
31+
audience: sts.amazonaws.com
32+
33+
- name: Update kubeconfig for EKS
34+
run: |
35+
aws eks update-kubeconfig --region us-east-2 --name jaseci-cluster
36+
kubectl config current-context
37+
38+
- name: Set up Python 3.12
39+
uses: actions/setup-python@v5
40+
with:
41+
python-version: '3.12'
42+
43+
- name: Install Jaseci packages
44+
run: |
45+
pip install --upgrade pip
46+
pip install jaclang jac-client jac-scale
47+
48+
- name: Deploy jac-shadcn with jac-scale
49+
run: |
50+
jac start main.jac --scale
51+
working-directory: jac-shadcn
52+
53+
- name: Verify deployment
54+
run: |
55+
echo "Checking deployment status..."
56+
kubectl get deployments -n jac-shadcn
57+
kubectl get services -n jac-shadcn
58+
kubectl get pods -n jac-shadcn
59+
60+
- name: Deployment Summary
61+
if: always()
62+
run: |
63+
echo "## jac-shadcn Deployment Summary" >> $GITHUB_STEP_SUMMARY
64+
echo "### Configuration" >> $GITHUB_STEP_SUMMARY
65+
echo "- **App Name**: jac-shadcn" >> $GITHUB_STEP_SUMMARY
66+
echo "- **Namespace**: jac-shadcn" >> $GITHUB_STEP_SUMMARY
67+
echo "- **Cluster**: jaseci-cluster" >> $GITHUB_STEP_SUMMARY
68+
echo "- **Region**: us-east-2" >> $GITHUB_STEP_SUMMARY
69+
echo "- **Triggered By**: ${{ github.event_name }}" >> $GITHUB_STEP_SUMMARY
70+
if [[ "${{ github.event_name }}" == "release" ]]; then
71+
echo "- **Release Tag**: ${{ github.event.release.tag_name }}" >> $GITHUB_STEP_SUMMARY
72+
fi
73+
echo "" >> $GITHUB_STEP_SUMMARY
74+
echo "### Deployment Status" >> $GITHUB_STEP_SUMMARY
75+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
76+
kubectl get all -n jac-shadcn 2>&1 >> $GITHUB_STEP_SUMMARY || echo "Unable to fetch deployment status" >> $GITHUB_STEP_SUMMARY
77+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY

jac.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,7 @@ lib_imports = ["import tailwindcss from '@tailwindcss/vite'"]
7171

7272
[plugins.client.configs.tailwind]
7373
content = ["./src/**/*.{jac,tsx,jsx}"]
74+
75+
[plugins.scale.kubernetes]
76+
app_name = "jac-shadcn"
77+
namespace = "jac-shadcn"

0 commit comments

Comments
 (0)