name: Deploy to FTP

on:
  push:
    branches:
      - master

jobs:
  deploy:
    runs-on: ubuntu-latest
    container:
      image: node:20

    steps:
      - name: Checkout repo
        uses: actions/checkout@v4

      - name: Inject commit SHA
        run: |
          echo "${{ env.GITHUB_SHA }}" > version.sha

      - name: Upload via FTP
        uses: SamKirkland/FTP-Deploy-Action@v4.3.4
        with:
          server: ${{ secrets.FTP_HOST }}
          username: ${{ secrets.FTP_USER }}
          password: ${{ secrets.FTP_PASS }}
          local-dir: app/src/main/assets/
          server-dir: /

