Skip to content

Commit 359075a

Browse files
committed
Update build.yml
1 parent dcd80ba commit 359075a

File tree

1 file changed

+10
-23
lines changed

1 file changed

+10
-23
lines changed

.github/workflows/build.yml

+10-23
Original file line numberDiff line numberDiff line change
@@ -10,46 +10,34 @@ on:
1010

1111
jobs:
1212
build:
13-
runs-on: windows-latest # Using Windows runner
13+
runs-on: windows-latest
1414

1515
steps:
16-
- name: Checkout main code
16+
- name: Checkout code
1717
uses: actions/checkout@v2
1818

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-
3419
- name: Set up Node.js
3520
uses: actions/setup-node@v2
3621
with:
3722
node-version: '18'
3823

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+
3930
- name: Clear Electron Builder Cache
4031
run: |
4132
if (Test-Path "$HOME\.cache\electron-builder") {
4233
Remove-Item -Recurse -Force "$HOME\.cache\electron-builder"
43-
} else {
44-
Write-Host "Cache directory does not exist, skipping removal."
4534
}
4635
4736
- name: Install dependencies
4837
run: npm install
4938

5039
- name: Package the app for Windows
5140
run: |
52-
# Build for Windows without publishing
5341
npx electron-builder --win nsis -p never
5442
env:
5543
GH_TOKEN: ${{ secrets.GH_TOKEN }}
@@ -62,10 +50,9 @@ jobs:
6250
artifacts: |
6351
dist/*.exe
6452
token: ${{ secrets.PAT_TOKEN }} # Use your PAT here
65-
skipIfReleaseExists: true # Skip if the release already exists
53+
skipIfReleaseExists: true
6654

67-
# Optional: Clean up after the build
6855
- name: Cleanup
6956
run: |
7057
echo "Cleaning up build artifacts"
71-
Remove-Item -Recurse -Force dist
58+
Remove-Item -Recurse -Force dist/*

0 commit comments

Comments
 (0)