mirror of
https://github.com/neosubhamoy/neosubhamoy-portfolio.git
synced 2025-12-19 17:03:01 +05:30
(CI/CD): added drop script to clean database before updating
This commit is contained in:
5
.github/workflows/main.yml
vendored
5
.github/workflows/main.yml
vendored
@@ -2,6 +2,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
name: 🚀 Deploy website on server
|
name: 🚀 Deploy website on server
|
||||||
jobs:
|
jobs:
|
||||||
web-deploy:
|
web-deploy:
|
||||||
@@ -12,7 +13,9 @@ jobs:
|
|||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: 📦 Update Database
|
- name: 📦 Update Database
|
||||||
run: mysql -h ${{ secrets.DB_HOST }} --port 3306 -u${{ secrets.DB_USERNAME }} -p${{ secrets.DB_PASSWORD }} -D${{ secrets.DB_NAME }} -e "source 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"
|
||||||
|
|
||||||
- name: 📂 Sync files
|
- name: 📂 Sync files
|
||||||
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
|
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
|
||||||
|
|||||||
3
drop_script.sql
Normal file
3
drop_script.sql
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
SET foreign_key_checks = 0;
|
||||||
|
DROP TABLE IF EXISTS `featured_projects`, `pages`, `profile`, `projects`, `quick_actions`, `socials`, `working_on`;
|
||||||
|
SET foreign_key_checks = 1;
|
||||||
Reference in New Issue
Block a user