add CI stuff + yarn 2
Some checks failed
continuous-integration/drone/push Build is failing

Signed-off-by: Sam Therapy <sam@samtherapy.net>
This commit is contained in:
Sam Therapy 2023-01-20 22:53:31 +01:00
parent b29f9c4e88
commit c64a627438
Signed by: sam
GPG key ID: 4D8B07C18F31ACBD
6 changed files with 14900 additions and 10542 deletions

42
.drone.yml Normal file
View file

@ -0,0 +1,42 @@
kind: pipeline
type: docker
name: Deploy
clone:
disable: true
steps:
- name: Clone
image: woodpeckerci/plugin-git
settings:
recursive: true
- name: Build
depends_on:
- Clone
image: node:16
commands:
- yarn
- yarn build
when:
event:
- push
- name: Execute deploy script
depends_on:
- Build
image: ubuntu:latest
environment:
SSH_KEY:
from_secret: SSH_KEY
commands:
- apt update && apt install -y openssh-client rsync
- ./ci/add-key.sh
- ./ci/deploy.sh
when:
event:
- push
branch:
- froth
- froth-akkoma
- froth-zero

10
.gitignore vendored
View file

@ -7,3 +7,13 @@ test/e2e/reports
selenium-debug.log
.idea/
config/local.json
.dccache
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

1
.yarnrc.yml Normal file
View file

@ -0,0 +1 @@
nodeLinker: node-modules

17
ci/add-key.sh Executable file
View file

@ -0,0 +1,17 @@
#!/bin/sh
# only execute this script as part of the pipeline.
[ -z "$CI" ] && echo "missing ci environment variable" && exit 2
# only execute the script when github token exists.
[ -z "$SSH_KEY" ] && echo "missing ssh key" && exit 3
# write the ssh key.
mkdir /root/.ssh
echo -n "${SSH_KEY}" > /root/.ssh/id_ed25519
chmod 600 /root/.ssh/id_ed25519
# add froth.zone to our known hosts.
touch /root/.ssh/known_hosts
chmod 600 /root/.ssh/known_hosts
ssh-keyscan -H froth.zone > /etc/ssh/ssh_known_hosts 2> /dev/null

11
ci/deploy.sh Executable file
View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
TARGET="pleroma@froth.zone:/opt/pleroma-zero"
#rsync -ra public/ "${TARGET}/instance/static"
#cp dist/index.html "${TARGET}/instance/static/index.html"
rsync --update -Pr dist/ "${TARGET}"
#rsync --update -ra dist/static/ "${TARGET}/instance/static/static"
#rsync --delete -ra images/ "${TARGET}/instance/static/images"
#rsync --delete -ra sounds/ "${TARGET}/instance/static/sounds"
#rsync -ra instance/ "${TARGET}/instance/static/instance"
#rsync --delete -ra pages/ "${TARGET}/instance/static/pages"

25361
yarn.lock

File diff suppressed because it is too large Load diff