Skip to content

Sync inventory

Sync inventory #2

Workflow file for this run

name: Sync inventory
on:
workflow_dispatch:
schedule:
- cron: '0 2 * * 0'
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install mysql-to-sqlite3
- name: Get inventory data
run: mysql2sqlite -f inventory.db -d ${{ secrets.INVENTORY_DB }} -u ${{ secrets.INVENTORY_USER }} --mysql-password ${{ secrets.INVENTORY_PASSWORD }} -h ${{ secrets.INVENTORY_HOST }}
- name: Upload inventory.db
uses: bayssmekanique/action-simple-file-upload@v2
with:
user: ${{ secrets.FTP_USER }}
password: ${{ secrets.FTP_PASSWORD }}
host: ${{ secrets.FTP_HOST }}
src: inventory.db
dest: inventory.db