diff --git a/.github/workflows/sync-nubank-to-ynab.yml b/.github/workflows/sync-nubank-to-ynab.yml deleted file mode 100644 index c47fdbe..0000000 --- a/.github/workflows/sync-nubank-to-ynab.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Sync transactions from Nubank to my YNAB(You Need A Budget) every 4 hours -on: - schedule: - - cron: 0 */4 * * * # Every 4 hours - push: - branches: - - trunk -jobs: - sync: - env: - YNAB_TOKEN: ${{ secrets.YNAB_TOKEN }} - CPF: ${{ secrets.CPF }} - PASSWORD: ${{ secrets.PASSWORD }} - PATH_TO_CERTIFICATE: ${{ secrets.PATH_TO_CERTIFICATE }} - NUBANK_CERTIFICATE: ${{ secrets.NUBANK_CERTIFICATE }} - runs-on: ubuntu-latest - timeout-minutes: 10 - - steps: - - name: Check out repository code - uses: actions/checkout@v2 - # Setup Python (faster than using Python container) - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: "3.9" - - name: Install pipenv - run: | - python -m pip install --upgrade pipenv wheel - - id: cache-pipenv - uses: actions/cache@v1 - with: - path: ~/.local/share/virtualenvs - key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }} - - name: Install dependencies - if: steps.cache-pipenv.outputs.cache-hit != 'true' - run: | - pipenv install --dev -# - name: Run test suite -# run: | -# pipenv run pytest - - name: Run sync from nubank to ynab - run: | - pipenv run make run diff --git a/.github/workflows/sync-to-ynab.yml b/.github/workflows/sync-to-ynab.yml new file mode 100644 index 0000000..52d8525 --- /dev/null +++ b/.github/workflows/sync-to-ynab.yml @@ -0,0 +1,29 @@ +name: Sync transactions from Nubank and Itaú to my YNAB(You Need A Budget) every 1 hour +on: + schedule: + - cron: 0 */1 * * * # Every 1 hour + push: + branches: + - trunk +jobs: + sync: + env: + YNAB_TOKEN: ${{ secrets.YNAB_TOKEN }} + PLUGGY_CLIENT_ID: ${{ secrets.PLUGGY_CLIENT_ID }} + PLUGGY_CLIENT_SECRET: ${{ secrets.PLUGGY_CLIENT_SECRET }} + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Install the latest version of uv + uses: astral-sh/setup-uv@v3 + with: + version: "latest" + enable-cache: true + - run: uv --version + - run: python --version + - name: Run sync to ynab + run: | + uv run python financas_automatizadas/main.py