Skip to content

Commit

Permalink
Add SQLite databases to DB dump action
Browse files Browse the repository at this point in the history
  • Loading branch information
Gtker committed Feb 24, 2023
1 parent 77623be commit e40a60d
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion .github/workflows/db_dump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,20 @@ jobs:
# cp ${{github.workspace}}/sql/migrations/logs_db_updates.sql ${{github.workspace}}/dbexport/db_dump/update_check_only_do_not_import/logs_db_updates.sql
# cp ${{github.workspace}}/sql/migrations/characters_db_updates.sql ${{github.workspace}}/dbexport/db_dump/update_check_only_do_not_import/characters_db_updates.sql
- name: Install SQLite dependencies
run: |
sudo apt install sqlite3 awk -y
git clone https://github.com/dumblob/mysql2sqlite
chmod +x ${{github.workspace}}/mysql2sqlite/mysql2sqlite
- name: Create SQLite databases
run: |
${{github.workspace}}/mysql2sqlite/mysql2sqlite ${{github.workspace}}/dbexport/db_dump/mangos.sql | sqlite3 ${{github.workspace}}/dbexport/sqlite_dump/mangos.sqlite
${{github.workspace}}/mysql2sqlite/mysql2sqlite ${{github.workspace}}/dbexport/db_dump/logon.sql | sqlite3 ${{github.workspace}}/dbexport/sqlite_dump/logon.sqlite
${{github.workspace}}/mysql2sqlite/mysql2sqlite ${{github.workspace}}/dbexport/db_dump/logs.sql | sqlite3 ${{github.workspace}}/dbexport/sqlite_dump/logs.sqlite
${{github.workspace}}/mysql2sqlite/mysql2sqlite ${{github.workspace}}/dbexport/db_dump/characters.sql | sqlite3 ${{github.workspace}}/dbexport/sqlite_dump/characters.sqlite
- name: Create New tables
run: |
docker exec mysqldb sh -c 'exec mysql -u root -proot -e "CREATE DATABASE IF NOT EXISTS realmd2 DEFAULT CHARSET utf8 COLLATE utf8_general_ci;"'
Expand All @@ -98,19 +112,32 @@ jobs:
run: |
cd ${{github.workspace}}/dbexport
7z a -tzip db-${{steps.vars.outputs.sha_short}}.zip db_dump
7z a -tzip db-sqlite-${{steps.vars.outputs.sha_short}}.zip sqlite_dump
- name: Archive this artefact
- name: Archive SQL artifact
uses: actions/upload-artifact@v2
with:
name: snapshot-db-dump
path: "${{github.workspace}}/dbexport/db-${{steps.vars.outputs.sha_short}}.zip"

- name: Archive SQLite artifact
uses: actions/upload-artifact@v2
with:
name: snapshot-db-sqlite-dump
path: "${{github.workspace}}/dbexport/db-sqlite-${{steps.vars.outputs.sha_short}}.zip"

- name: Download artifact snapshot-db-dump
uses: actions/download-artifact@v1
with:
name: snapshot-db-dump
path: all_snapshots

- name: Download artifact snapshot-db-sqlite-dump
uses: actions/download-artifact@v1
with:
name: snapshot-db-sqlite-dump
path: all_snapshots

- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
Expand Down

0 comments on commit e40a60d

Please sign in to comment.