name: Modelari site build and deploy
run-name: ${{ gitea.actor }}
on: [push]

jobs:
  Build-site:
    runs-on: ubuntu-latest-ubuntu
    steps:
      - name: Check out repository code
        uses: actions/checkout@v4
      - name: Copy html files to server
        uses: appleboy/scp-action@v0.1.7
        with:
          host: ${{ secrets.WALTER }}
          username: ${{ secrets.WALTER_USERNAME }}
          key: ${{ secrets.WALTER_SSH_KEY }}
          port: 22
          source: "*.html"
          target: "/opt/infra/modelari/web/site/"
      - name: Copy image files to server
        uses: appleboy/scp-action@v0.1.7
        with:
          host: ${{ secrets.WALTER }}
          username: ${{ secrets.WALTER_USERNAME }}
          key: ${{ secrets.WALTER_SSH_KEY }}
          port: 22
          source: "img/*"
          target: "/opt/infra/modelari/web/site/"
      - name: Copy css files to server
        uses: appleboy/scp-action@v0.1.7
        with:
          host: ${{ secrets.WALTER }}
          username: ${{ secrets.WALTER_USERNAME }}
          key: ${{ secrets.WALTER_SSH_KEY }}
          port: 22
          source: "*.css"
          target: "/opt/infra/modelari/web/site/"
      - run: echo "This job's status is ${{ job.status }}."
