on: 
  push:
    branches: 
      - develop
name: Deploy theme to Staging
jobs:
  FTP-Deploy-Action:
    name: FTP-Deploy-Action
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - name: Set up Node.js
        uses: actions/setup-node@master
        with:
          node-version: '12.x'
      - run: npm install --legacy-peer-deps
      - run: npm run build
      - name: RSync-Deploy-Action
        id: deploy_staging
        uses: Pendect/action-rsyncer@v1.1.0
        env:
          DEPLOY_KEY: ${{ secrets.DEPLOY_KEY_STAGING }}
        with:
          flags: '-avzr --delete'
          options: '--exclude "src" --exclude ".git" --exclude "README.md" --exclude "package.json" --exclude "package-lock.json" --exclude "Gruntfile.js" --exclude "yarn.lock" --exclude ".github" --exclude "node_modules" --exclude ".gitignore"'
          src: '.'
          dest: 'julienbrh@ftp.cluster015.hosting.ovh.net:/home/julienbrh/lamyFormation'
      - name: Display status from deploy
        run: echo "${{ steps.deploy_staging.outputs.status }}"
