|
10 | 10 |
|
11 | 11 | jobs:
|
12 | 12 | build:
|
13 |
| - runs-on: windows-latest # Using Windows runner |
| 13 | + runs-on: windows-latest |
14 | 14 |
|
15 | 15 | steps:
|
16 |
| - - name: Checkout main code |
| 16 | + - name: Checkout code |
17 | 17 | uses: actions/checkout@v2
|
18 | 18 |
|
19 |
| - - name: Checkout gh-pages branch |
20 |
| - uses: actions/checkout@v2 |
21 |
| - with: |
22 |
| - repository: th3cyb3rhub/TheCyberHUB |
23 |
| - ref: gh-pages |
24 |
| - path: ./ # Check out into a subdirectory |
25 |
| - |
26 |
| - - name: Copy content from gh-pages to current directory |
27 |
| - run: | |
28 |
| - if (Test-Path "gh-pages") { |
29 |
| - Copy-Item -Recurse -Force "./*" "." |
30 |
| - } else { |
31 |
| - Write-Host "gh-pages directory does not exist." |
32 |
| - } |
33 |
| -
|
34 | 19 | - name: Set up Node.js
|
35 | 20 | uses: actions/setup-node@v2
|
36 | 21 | with:
|
37 | 22 | node-version: '18'
|
38 | 23 |
|
| 24 | + - name: Clone the gh-pages branch |
| 25 | + run: | |
| 26 | + git clone --single-branch --branch gh-pages https://github.com/th3cyb3rhub/TheCyberHUB.git temp |
| 27 | + # Copy necessary files into your source directory |
| 28 | + cp -R temp/* . # Adjust this if needed |
| 29 | +
|
39 | 30 | - name: Clear Electron Builder Cache
|
40 | 31 | run: |
|
41 | 32 | if (Test-Path "$HOME\.cache\electron-builder") {
|
42 | 33 | Remove-Item -Recurse -Force "$HOME\.cache\electron-builder"
|
43 |
| - } else { |
44 |
| - Write-Host "Cache directory does not exist, skipping removal." |
45 | 34 | }
|
46 | 35 |
|
47 | 36 | - name: Install dependencies
|
48 | 37 | run: npm install
|
49 | 38 |
|
50 | 39 | - name: Package the app for Windows
|
51 | 40 | run: |
|
52 |
| - # Build for Windows without publishing |
53 | 41 | npx electron-builder --win nsis -p never
|
54 | 42 | env:
|
55 | 43 | GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
62 | 50 | artifacts: |
|
63 | 51 | dist/*.exe
|
64 | 52 | token: ${{ secrets.PAT_TOKEN }} # Use your PAT here
|
65 |
| - skipIfReleaseExists: true # Skip if the release already exists |
| 53 | + skipIfReleaseExists: true |
66 | 54 |
|
67 |
| - # Optional: Clean up after the build |
68 | 55 | - name: Cleanup
|
69 | 56 | run: |
|
70 | 57 | echo "Cleaning up build artifacts"
|
71 |
| - Remove-Item -Recurse -Force dist |
| 58 | + Remove-Item -Recurse -Force dist/* |
0 commit comments