name: Move Public Folder
run-name: Le site Meridian se met à jour

on:
  push:
    branches:
      - main

jobs:
  deploy:
    runs-on: linux_arm

      - name: Copy images
        run: cp -r static/uploads/screenshots assets/images

    steps:
      - name: Checkout repository
        uses: actions/checkout@v3

      - name: Setup Node
        run: npm ci
        
      - name: Build TinaCMS
        env:
          TINA_PUBLIC_CLIENT_ID: ${{ secrets.TINA_PUBLIC_CLIENT_ID }}
          TINA_TOKEN: ${{ secrets.TINA_TOKEN }}
        run: npx tinacms build

      - name: Hugo setup
        uses: peaceiris/actions-hugo@v2
        with:
          hugo-version: '0.119.0'
          extended: true

      - name: Build
        run: hugo --minify
        
      - name: test Public Folder
        run: touch /var/www/my_webapp/test.md
