File tree Expand file tree Collapse file tree 3 files changed +104
-0
lines changed
Expand file tree Collapse file tree 3 files changed +104
-0
lines changed Original file line number Diff line number Diff line change 1+ name : CI
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ pull_request :
8+
9+ permissions :
10+ actions : read
11+ contents : read
12+
13+ jobs :
14+ main :
15+ runs-on : ubuntu-latest
16+ steps :
17+ - uses : actions/checkout@v4
18+ with :
19+ filter : tree:0
20+ fetch-depth : 0
21+
22+ # This enables task distribution via Nx Cloud
23+ # Run this command as early as possible, before dependencies are installed
24+ # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
25+ # Uncomment this line to enable task distribution
26+ # - run: npx nx start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci"
27+
28+ # Cache node_modules
29+ - uses : actions/setup-node@v4
30+ with :
31+ node-version : 20
32+ cache : ' npm'
33+
34+ - run : npm ci --legacy-peer-deps
35+ - run : npx playwright install --with-deps
36+
37+ # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
38+ # - run: npx nx-cloud record -- echo Hello World
39+ # When you enable task distribution, run the e2e-ci task instead of e2e
40+ - run : npx nx run-many -t lint test build typecheck e2e
41+ # Nx Cloud recommends fixes for failures to help you get CI green faster. Learn more: https://nx.dev/ci/features/self-healing-ci
42+ - run : npx nx fix-ci
43+ if : always()
Original file line number Diff line number Diff line change 1+ name : Regenerate Repository
2+
3+ on :
4+ # Manual trigger
5+ workflow_dispatch :
6+
7+ # Weekly schedule (Sundays at 2 AM UTC)
8+ schedule :
9+ - cron : ' 0 2 * * 0'
10+
11+ permissions :
12+ contents : write
13+
14+ jobs :
15+ regenerate-template :
16+ runs-on : ubuntu-latest
17+
18+ steps :
19+ - name : Checkout workflow repository
20+ uses : actions/checkout@v4
21+
22+ - name : Setup Node.js (if needed for generation script)
23+ uses : actions/setup-node@v4
24+ with :
25+ node-version : ' 22'
26+
27+ - name : Configure Git
28+ run : |
29+ git config --global user.name "Template Generator Bot"
30+ git config --global user.email "[email protected] " 31+
32+ - name : Clear repository contents (preserve .git)
33+ run : |
34+ # Remove all files except .git directory
35+ find . -mindepth 1 -maxdepth 1 ! -name '.git' -exec rm -rf {} +
36+
37+ - name : Generate new content
38+ run : |
39+ npx -y create-nx-workspace@latest org --preset=react-monorepo --appName=myapp --routing=true --useReactRouter=false --style=css --bundler=vite --unitTestRunner=vitest --e2eTestRunner=playwright --framework=none --ci=skip --skipGit=true --no-interactive
40+ mv org/* . 2>/dev/null
41+ mv org/.* . 2>/dev/null
42+ rm -rf org
43+
44+ - name : Commit and push changes
45+ env :
46+ GITHUB_TOKEN : ${{ github.token }}
47+ run : |
48+ git add .
49+ if git diff --staged --quiet; then
50+ echo "No changes to commit"
51+ else
52+ git commit -m "🤖 Regenerate repository content - $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
53+ git push origin main
54+ echo "Changes pushed successfully"
55+ fi
56+
57+ - name : Cleanup
58+ if : always()
59+ run : |
60+ rm -rf target-repo
Original file line number Diff line number Diff line change 1+ .idea
You can’t perform that action at this time.
0 commit comments