mirror of
https://github.com/neosubhamoy/neosubhamoy-portfolio.git
synced 2025-12-20 01:09:35 +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:
|
||||
branches:
|
||||
- main
|
||||
|
||||
name: 🚀 Deploy website on server
|
||||
jobs:
|
||||
web-deploy:
|
||||
@@ -12,7 +13,9 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- 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
|
||||
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