Skip to content

Commit 57b6d75

Browse files
committed
feat: add mercure token
1 parent f983b8f commit 57b6d75

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.github/workflows/deploy-vps.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,21 @@ jobs:
2525
- name: 🔍 Install dependencies
2626
run: npm install
2727

28+
- name: 📝 Inject secret in .env.production
29+
run: |
30+
echo "🔐 Injecting MERCURE_TOKEN into .env.production"
31+
if [ -f .env.production ]; then
32+
sed -i "s|^VITE_MERCURE_TOKEN=.*|VITE_MERCURE_TOKEN=${{ secrets.MERCURE_TOKEN }}|" .env.production
33+
else
34+
echo "❌ .env.production not found" && exit 1
35+
fi
36+
2837
- name: 🧱 Build application
2938
run: npm run build
3039

3140
- name: 🔑 Copy .env file
3241
run: cp .env.production dist/.env
3342

34-
- name: 📝 Update .env with Secrets
35-
run: |
36-
sed -i "s|VITE_MERCURE_TOKEN=.*|VITE_MERCURE_TOKEN=${{ secrets.MERCURE_TOKEN }}|" dist/.env
37-
3843
- name: 📤 Deploy to VPS
3944
uses: easingthemes/ssh-deploy@main
4045
with:

0 commit comments

Comments
 (0)