Test deploying actions.

This commit is contained in:
Emiliano Vavassori 2024-03-02 01:26:27 +01:00
parent b14c0cf1b1
commit 66d3307980
2 changed files with 28 additions and 3 deletions

View File

@ -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

View File

@ -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