From 66d3307980cbe93ae0a458bcf970f02df0a4aed9 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Sat, 2 Mar 2024 01:26:27 +0100 Subject: [PATCH] Test deploying actions. --- .drone.yml | 7 ++++--- .gitea/workflows/build-deploy.yml | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 .gitea/workflows/build-deploy.yml diff --git a/.drone.yml b/.drone.yml index 1b7e824..aa4b017 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,7 +1,7 @@ --- kind: pipeline type: docker -name: default +name: build-and-deploy steps: - name: Build @@ -10,7 +10,6 @@ steps: - . /app/venv/bin/activate - pip install -r requirements.txt - pelican content -s publishconf.py - - cat output/index.html - name: Deploy image: drillster/drone-rsync @@ -29,6 +28,8 @@ steps: script: - "sudo chown root:www-data -R /var/www/conference" -triggers: +trigger: + branch: + - master event: - push diff --git a/.gitea/workflows/build-deploy.yml b/.gitea/workflows/build-deploy.yml new file mode 100644 index 0000000..8019e0c --- /dev/null +++ b/.gitea/workflows/build-deploy.yml @@ -0,0 +1,24 @@ +--- +name: Build and Deploy +on: [push] +jobs: + Build: + runs-on: site-builder + steps: + - run: . /app/venv/bin/activate + - run: pip install -r requirements.txt + - run: pelican content -s publishconf.py + + 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