|
1 | | -name: Deploy to GitHub Pages |
| 1 | +name: Deploy ZKPDF |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | 5 | branches: [main, dev] |
| 6 | + paths: |
| 7 | + - "app/**" |
| 8 | + - "docs/**" |
| 9 | + - "pdf-utils/**" |
| 10 | + - "scripts/**" |
| 11 | + - ".github/workflows/deploy.yml" |
6 | 12 | pull_request: |
7 | 13 | branches: [main] |
8 | 14 |
|
@@ -43,69 +49,20 @@ jobs: |
43 | 49 | target: wasm32-unknown-unknown |
44 | 50 | override: true |
45 | 51 |
|
46 | | - - name: Install dependencies |
47 | | - run: yarn install --frozen-lockfile |
48 | | - working-directory: ./app |
| 52 | + - name: Make deploy script executable |
| 53 | + run: chmod +x scripts/deploy.sh |
49 | 54 |
|
50 | | - - name: Build WASM |
51 | | - run: | |
52 | | - cd pdf-utils/wasm |
53 | | - chmod +x generate_wasm.sh |
54 | | - ./generate_wasm.sh |
55 | | -
|
56 | | - - name: Copy WASM files to public directory |
57 | | - run: | |
58 | | - mkdir -p app/public/pkg |
59 | | - cp pdf-utils/wasm/pkg/* app/public/pkg/ |
60 | | -
|
61 | | - - name: Build Next.js app |
62 | | - run: yarn build |
63 | | - working-directory: ./app |
64 | | - |
65 | | - - name: Install mdbook |
66 | | - run: cargo install mdbook |
67 | | - |
68 | | - - name: Build documentation |
69 | | - run: | |
70 | | - cd docs |
71 | | - chmod +x build.sh |
72 | | - ./build.sh |
| 55 | + - name: Deploy using unified script |
| 56 | + run: ./scripts/deploy.sh all |
73 | 57 |
|
74 | 58 | - name: Setup Pages |
75 | 59 | uses: actions/configure-pages@v4 |
76 | 60 |
|
77 | | - - name: Create combined deployment |
78 | | - run: | |
79 | | - # Create a combined deployment directory |
80 | | - mkdir -p combined-deploy |
81 | | -
|
82 | | - # Copy app files to root |
83 | | - cp -r app/out/* combined-deploy/ |
84 | | -
|
85 | | - # Copy docs to /docs subdirectory |
86 | | - mkdir -p combined-deploy/docs |
87 | | - cp -r docs/book/* combined-deploy/docs/ |
88 | | -
|
89 | | - # Create a simple index.html redirect for docs |
90 | | - cat > combined-deploy/docs/index.html << 'EOF' |
91 | | - <!DOCTYPE html> |
92 | | - <html> |
93 | | - <head> |
94 | | - <meta charset="utf-8"> |
95 | | - <title>ZKPDF Documentation</title> |
96 | | - <meta http-equiv="refresh" content="0; url=./introduction.html"> |
97 | | - </head> |
98 | | - <body> |
99 | | - <p>Redirecting to documentation... <a href="./introduction.html">Click here</a></p> |
100 | | - </body> |
101 | | - </html> |
102 | | - EOF |
103 | | -
|
104 | 61 | - name: Upload combined artifact |
105 | 62 | uses: actions/upload-pages-artifact@v3 |
106 | 63 | with: |
107 | 64 | path: ./combined-deploy |
108 | 65 |
|
109 | | - - name: Deploy app to GitHub Pages |
| 66 | + - name: Deploy to GitHub Pages |
110 | 67 | id: deployment |
111 | 68 | uses: actions/deploy-pages@v4 |
0 commit comments