1
1
mirror of https://github.com/neosubhamoy/neosubhamoy-portfolio.git synced 2025-12-20 01:09:35 +05:30

(CI/CD): run Update Database step only when neosubhamoy.sql is updated

This commit is contained in:
2023-12-03 20:42:42 +05:30
parent f27ee5b9cb
commit ad91370677

View File

@@ -2,6 +2,8 @@ on:
push: push:
branches: branches:
- main - main
paths:
- 'neosubhamoy.sql'
name: 🚀 Deploy website on server name: 🚀 Deploy website on server
jobs: jobs:
@@ -13,6 +15,7 @@ jobs:
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: 📦 Update Database - name: 📦 Update Database
if: github.event_name == 'push' && github.event_path == 'neosubhamoy.sql'
run: | 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 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" mysql -h ${{ secrets.DB_HOST }} --port 3306 -u${{ secrets.DB_USERNAME }} -p${{ secrets.DB_PASSWORD }} -D${{ secrets.DB_NAME }} -e "source neosubhamoy.sql"