From 01d7c160ed2d0234c77a5dc53461b20b704cde01 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Sat, 2 Mar 2024 18:41:05 +0100 Subject: [PATCH] Sistemati workflow? --- .gitea/workflows/base.yml | 8 ++++++++ .gitea/workflows/build-deploy.yml | 29 +++++++++++++++++------------ 2 files changed, 25 insertions(+), 12 deletions(-) create mode 100644 .gitea/workflows/base.yml diff --git a/.gitea/workflows/base.yml b/.gitea/workflows/base.yml new file mode 100644 index 0000000..a51c912 --- /dev/null +++ b/.gitea/workflows/base.yml @@ -0,0 +1,8 @@ +--- +name: show settings +on: [push] +jobs: + show_settings: + runs-on: site-builder + steps: + - run: echo ${{ gitea.workspace }} diff --git a/.gitea/workflows/build-deploy.yml b/.gitea/workflows/build-deploy.yml index 8b243df..97c479d 100644 --- a/.gitea/workflows/build-deploy.yml +++ b/.gitea/workflows/build-deploy.yml @@ -1,8 +1,8 @@ --- -name: Build and Deploy +name: build and deploy on: [push] jobs: - Build: + build: runs-on: site-builder steps: - run: git clone ${{ gitea.repository }} @@ -12,13 +12,18 @@ jobs: Deploy: runs-on: debian-bookworm steps: - - uses: easingthemes/ssh-deploy@main - env: - SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} - SOURCE: output/ - REMOTE_HOST: ${{ secrets.REMOTE_HOST }} - REMOTE_USER: ${{ secrets.REMOTE_USER }} - REMOTE_PORT: ${{ secrets.REMOTE_PORT }} - TARGET: /var/www/conference - SCRIPT_AFTER: | - sudo chown -R root:www-data /var/www/conference + - uses: burnett01/rsync-deployments@6.0.0 + with: + path: output/ + remote_host: ${{ secrets.REMOTE_HOST }} + remote_port: ${{ secrets.REMOTE_PORT }} + remote_user: ${{ secrets.REMOTE_USER }} + remote_key: ${{ secrets.SSH_PRIVATE_KEY }} + remote_path: /var/www/conference + - uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.REMOTE_HOST }} + port: ${{ secrets.REMOTE_PORT }} + username: ${{ secrets.REMOTE_USER }} + key: ${{ secrets.SSH_PRIVATE_KEY }} + script: sudo chown -R root:www-data /var/www/conference