name: Jungleparadise Staging
on:
  push:
    branches: 
      - development


jobs:
  job_one:
    name: Deploy
    runs-on: ubuntu-latest
    steps:
    - name: pushing latest change on www2.jungleparadise.tf
      uses: appleboy/ssh-action@master
      with:
        host: www2.jungleparadise.tf
        username: ${{ secrets.TF_USER }}
        key: ${{ secrets.TF_SECRET }}
        port: ${{ secrets.TF_PORT }}
        script: |
          cd websites/www2/www_jungle_paradise/
          git log -1
          git fetch
          git reset --hard origin/development
          sed -i "s/https:\/\/jungleparadise.tf/https:\/\/www2.jungleparadise.tf/g" config.toml
          bash build.sh
