Skip to content

Commit fbbde07

Browse files
committed
Update deploy.yml
1 parent 9ae38e1 commit fbbde07

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

.github/workflows/deploy.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Deploy to GitHub Pages
22

33
on:
44
push:
5-
branches: [ "dev" ] # Only trigger on master branch
5+
branches: [ "dev" ] # Trigger on dev branch
66
paths-ignore:
77
- '**.md'
88
- '**.txt'
@@ -19,14 +19,36 @@ jobs:
1919
steps:
2020
- name: Checkout repository
2121
uses: actions/checkout@v4
22-
with:
23-
ref: master # Explicitly checkout the master branch
22+
# Remove the ref: master line since we want to use the branch that triggered the workflow
2423

2524
- name: Set up Node.js
2625
uses: actions/setup-node@v4
2726
with:
2827
node-version: '20'
2928

29+
- name: Check directory contents
30+
run: ls -la
31+
32+
- name: Create package.json if not exists
33+
run: |
34+
if [ ! -f package.json ]; then
35+
echo "Creating basic package.json"
36+
cat > package.json << 'EOF'
37+
{
38+
"name": "khalilcharfi-portfolio",
39+
"version": "1.0.0",
40+
"description": "Khalil Charfi's multilingual portfolio website",
41+
"scripts": {
42+
"build:all": "node scripts/build.js && node scripts/generate-redirect.js && node scripts/generate-meta.js"
43+
},
44+
"dependencies": {
45+
"handlebars": "^4.7.8",
46+
"html-minifier": "^4.0.0"
47+
}
48+
}
49+
EOF
50+
fi
51+
3052
- name: Install dependencies
3153
run: npm i
3254

0 commit comments

Comments
 (0)