Skip to content

Commit 4e0969a

Browse files
authored
Update deploy-to-master.yml
1 parent fe17bfe commit 4e0969a

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

.github/workflows/deploy-to-master.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: Fast Deploy to Master Branch
1+
name: Ultra-Fast Deploy to Master Branch
22

33
on:
44
push:
55
branches: [ next ]
66
workflow_dispatch:
77

88
jobs:
9-
fast-deploy:
9+
deploy:
1010
runs-on: ubuntu-latest
1111

1212
steps:
@@ -29,10 +29,11 @@ jobs:
2929
npm ci
3030
npm install --save-dev terser
3131
32-
# 4️⃣ Create production .env (no NODE_ENV)
33-
- name: Create production .env
32+
# 4️⃣ Build + create .env + prepare deploy folder (all in one)
33+
- name: Build project and prepare deploy folder
3434
run: |
35-
echo "GEMINI_API_KEY=${{ secrets.GEMINI_API_KEY || '' }}" >> .env.production
35+
# Create production .env
36+
echo "GEMINI_API_KEY=${{ secrets.GEMINI_API_KEY || '' }}" > .env.production
3637
echo "VITE_ENABLE_CHATBOT=${{ secrets.VITE_ENABLE_CHATBOT || 'false' }}" >> .env.production
3738
echo "VITE_ENABLE_DYNAMIC_CONTENT=${{ secrets.VITE_ENABLE_DYNAMIC_CONTENT || 'false' }}" >> .env.production
3839
echo "VITE_SHOW_DEV_ELEMENTS=false" >> .env.production
@@ -41,29 +42,28 @@ jobs:
4142
echo "VITE_SHOW_TRANSLATION_DEBUG=false" >> .env.production
4243
echo "VITE_SHOW_DEBUG_INFO=false" >> .env.production
4344
44-
# 5️⃣ Build project
45-
- name: Build project
46-
run: npm run build:prod
45+
# Build project in production mode
46+
npm run build:prod
4747
48-
# 6️⃣ Ensure dist exists and prepare deploy folder
49-
- name: Prepare deploy folder
50-
run: |
48+
# Ensure dist exists
5149
if [ ! -d dist ]; then
52-
echo "Error: dist/ not found. Build failed."
50+
echo "Error: dist/ folder not found. Build failed."
5351
exit 1
5452
fi
53+
54+
# Prepare deploy folder
5555
mkdir -p deploy
5656
cp -r dist/* deploy/
5757
cp .env.production deploy/
5858
cp .env.example deploy/
5959
cp README.md deploy/
6060
cp package.json deploy/
6161
62-
# 7️⃣ Deploy directly to master branch using GitHub Pages action
62+
# 5️⃣ Deploy directly to master branch
6363
- name: Deploy to GitHub Pages (master branch)
6464
uses: peaceiris/actions-gh-pages@v3
6565
with:
6666
github_token: ${{ secrets.GITHUB_TOKEN }}
6767
publish_dir: ./deploy
6868
publish_branch: master
69-
force_orphan: true # replaces entire master content
69+
force_orphan: true # completely replaces master content

0 commit comments

Comments
 (0)