name: Copy Files to Samba Share dev
on:
  push:
    branches:
      - dev

jobs:
  copy_files:
    name: Copy Files
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Install smbclient
        run: |
          apt-get update
          apt-get install -y smbclient

      - name: install dependencies
        run: |
          npm ci

      - name: build application
        run: |
          npm run dev:deploy

      - name: Copy
        run: |
          smbclient //192.168.129.245/arne -U "${{ secrets.SAMBA_USER }}" "${{ secrets.SAMBA_PASSWORD }}" -c 'prompt OFF; recurse ON; cd letsencrypt/config/www/cptarn/dev/; lcd dist/cpt-arn/browser/; mput *'
