57 lines
1.7 KiB
YAML
57 lines
1.7 KiB
YAML
name: Build and Deploy Pivoine.Art via SSH
|
|
|
|
on:
|
|
workflow_dispatch: # Allows workflow to be run manually
|
|
push:
|
|
branches:
|
|
- main # Or your default branch
|
|
paths:
|
|
- 'Projects/pivoine.art/**'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ./Projects/pivoine.art
|
|
environment: ionos
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v4
|
|
- name: Install dependencies
|
|
run: pnpm install
|
|
- name: Build JavaScript
|
|
run: pnpm build:all
|
|
- name: 💎 Setup Ruby
|
|
uses: ruby/setup-ruby@v1
|
|
with:
|
|
ruby-version: 3.2.3 # Adjust as needed for your project
|
|
|
|
- name: 🏗️ Build Jekyll site
|
|
run: |
|
|
bundle install
|
|
bundle exec jekyll build --lsi --destination ${{ github.workspace }}/_site
|
|
|
|
- name: 🚀 Deploy via SSH
|
|
uses: appleboy/scp-action@master
|
|
with:
|
|
host: ${{ secrets.HOST }}
|
|
username: ${{ secrets.USERNAME }}
|
|
password: ${{ secrets.PASSWORD }}
|
|
port: ${{ secrets.PORT }}
|
|
source: _site/* # Adjust if required
|
|
target: /var/www/pivoine.art # Set to your deployment directory (for example /public_html)
|
|
strip_components: 1 # This ensures that a subdirectory is not created
|
|
rm: 1
|
|
- name: Docker compose restart
|
|
uses: appleboy/ssh-action@v1
|
|
with:
|
|
host: ${{ secrets.HOST }}
|
|
username: ${{ secrets.USERNAME }}
|
|
password: ${{ secrets.PASSWORD }}
|
|
port: ${{ secrets.PORT }}
|
|
script: |
|
|
cd Projects/kompose/blog
|
|
docker compose restart |