-
Notifications
You must be signed in to change notification settings - Fork 115
136 lines (116 loc) · 4.26 KB
/
Copy pathscreenshots.yml
File metadata and controls
136 lines (116 loc) · 4.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Update Documentation Screenshots
on:
schedule:
- cron: '0 6 * * *'
workflow_dispatch:
concurrency:
group: doc-screenshots
cancel-in-progress: true
permissions:
contents: write
pull-requests: write
jobs:
capture:
name: Capture Screenshots
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Cleanup Diskspace
uses: kubeflow/pipelines/.github/actions/github-disk-cleanup@master
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: e2e/package-lock.json
- name: Install Cypress dependencies
working-directory: e2e
run: npm ci
- name: Pull component images
run: |
for img in frontend backend operator claude_runner; do
docker pull quay.io/ambient_code/vteam_${img}:latest
docker tag quay.io/ambient_code/vteam_${img}:latest \
quay.io/ambient_code/vteam_${img}:e2e-test
done
- name: Install kind
run: |
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.27.0/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind
- name: Setup kind cluster
working-directory: e2e
run: |
chmod +x scripts/*.sh
./scripts/setup-kind.sh
- name: Load images into kind
run: |
for img in frontend backend operator claude_runner; do
kind load docker-image quay.io/ambient_code/vteam_${img}:e2e-test --name ambient-local
done
- name: Deploy (mock SDK mode)
working-directory: e2e
env:
IMAGE_FRONTEND: quay.io/ambient_code/vteam_frontend:e2e-test
IMAGE_BACKEND: quay.io/ambient_code/vteam_backend:e2e-test
IMAGE_OPERATOR: quay.io/ambient_code/vteam_operator:e2e-test
IMAGE_RUNNER: quay.io/ambient_code/vteam_claude_runner:e2e-test
run: ./scripts/deploy.sh
- name: Capture screenshots
working-directory: e2e
run: |
CYPRESS_SCREENSHOT_MODE=true \
CYPRESS_TEST_TOKEN="$(grep TEST_TOKEN .env.test | cut -d= -f2)" \
CYPRESS_BASE_URL="$(grep CYPRESS_BASE_URL .env.test | cut -d= -f2)" \
CYPRESS_ANTHROPIC_API_KEY=mock-replay-key \
npx cypress run --browser chrome --spec cypress/e2e/screenshots.cy.ts
- name: Copy screenshots to docs
run: |
mkdir -p docs/public/images/screenshots
find e2e/cypress/screenshots/output -name '*.png' ! -name '*failed*' -exec cp {} docs/public/images/screenshots/ \;
- name: Check for changes
id: changes
run: |
if git diff --quiet docs/public/images/screenshots/ 2>/dev/null; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
git diff --stat docs/public/images/screenshots/
fi
- name: Create PR with updated screenshots
if: steps.changes.outputs.changed == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
BRANCH="docs/update-screenshots-$(date +%Y%m%d)"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b "$BRANCH"
git add docs/public/images/screenshots/
git commit -m "docs: update automated screenshots $(date +%Y-%m-%d)"
git push origin "$BRANCH"
gh pr create \
--title "docs: update screenshots $(date +%Y-%m-%d)" \
--body "Automated daily screenshot update. Review changed PNGs in the Files tab." \
--label "docs,automated"
- name: Upload screenshots as artifact
if: always()
uses: actions/upload-artifact@v6
with:
name: doc-screenshots
path: e2e/cypress/screenshots/output/
if-no-files-found: ignore
retention-days: 7
- name: Debug logs on failure
if: failure()
run: |
echo "=== Frontend logs ==="
kubectl logs -n ambient-code -l app=frontend --tail=50 || true
echo "=== Backend logs ==="
kubectl logs -n ambient-code -l app=backend-api --tail=50 || true
- name: Cleanup
if: always()
working-directory: e2e
run: CLEANUP_ARTIFACTS=true ./scripts/cleanup.sh || true