mirror of
https://github.com/neosubhamoy/neosubhamoy-portfolio.git
synced 2025-12-20 02:19:34 +05:30
(CI/CD): run Update Database step only when neosubhamoy.sql is updated
This commit is contained in:
3
.github/workflows/main.yml
vendored
3
.github/workflows/main.yml
vendored
@@ -2,6 +2,8 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'neosubhamoy.sql'
|
||||
|
||||
name: 🚀 Deploy website on server
|
||||
jobs:
|
||||
@@ -13,6 +15,7 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: 📦 Update Database
|
||||
if: github.event_name == 'push' && github.event_path == 'neosubhamoy.sql'
|
||||
run: |
|
||||
mysql -h ${{ secrets.DB_HOST }} --port 3306 -u${{ secrets.DB_USERNAME }} -p${{ secrets.DB_PASSWORD }} -D${{ secrets.DB_NAME }} -e "source drop_script.sql"
|
||||
mysql -h ${{ secrets.DB_HOST }} --port 3306 -u${{ secrets.DB_USERNAME }} -p${{ secrets.DB_PASSWORD }} -D${{ secrets.DB_NAME }} -e "source neosubhamoy.sql"
|
||||
|
||||
Reference in New Issue
Block a user