2020-12-28 11:54:51 +00:00
|
|
|
kind: pipeline
|
|
|
|
name: update_website
|
2022-01-14 15:03:06 +00:00
|
|
|
|
2020-12-28 13:24:52 +00:00
|
|
|
steps:
|
2022-10-22 16:54:37 +01:00
|
|
|
- name: fetch_webmentions
|
|
|
|
image: python:3.7
|
|
|
|
when:
|
2021-01-14 11:54:20 +00:00
|
|
|
branch:
|
|
|
|
- main
|
2022-10-22 16:54:37 +01:00
|
|
|
commands:
|
|
|
|
- pip install poetry
|
|
|
|
- cd bstools
|
|
|
|
- poetry build
|
|
|
|
- pip install ./dist/bstools*.whl
|
|
|
|
- cd ../
|
|
|
|
- python -m bstools fetch-mentions --mentions-file ./brainsteam/data/mentions.json
|
|
|
|
- mkdir -p $HOME/.ssh
|
|
|
|
- echo "$SSH_KEY" > $HOME/.ssh/id_rsa
|
|
|
|
- chmod 600 $HOME/.ssh/id_rsa
|
|
|
|
- (git commit -a -m "Updating latest webmentions" && git push --set-upstream origin main) || exit 0
|
|
|
|
environment:
|
|
|
|
WEBMENTIONSIO_API_KEY:
|
|
|
|
from_secret: WEBMENTIONSIO_API_KEY
|
|
|
|
SSH_KEY:
|
|
|
|
from_secret:gitea_ssh_key
|
|
|
|
|
|
|
|
# - name: store_webmentions
|
|
|
|
# image: appleboy/drone-git-push
|
|
|
|
# when:
|
|
|
|
# branch:
|
|
|
|
# - main
|
|
|
|
# settings:
|
|
|
|
# remote_name: origin
|
|
|
|
# branch: main
|
|
|
|
# local_ref: main
|
|
|
|
# commit: true
|
|
|
|
# commit_message: Commit latest webmentions
|
|
|
|
# author_name: DroneCI
|
|
|
|
# ssh_key:
|
|
|
|
# from_secret: gitea_ssh_key
|
|
|
|
|
|
|
|
|
|
|
|
- name: build_site
|
|
|
|
image: appleboy/drone-ssh
|
|
|
|
settings:
|
|
|
|
host: newprobe.jamesravey.me
|
|
|
|
username: james
|
|
|
|
port: 22
|
|
|
|
key:
|
|
|
|
from_secret: ssh_key
|
|
|
|
script:
|
|
|
|
- cd /data/applications/brainsteam.co.uk
|
|
|
|
- git pull
|
|
|
|
- cd brainsteam
|
2022-10-22 16:56:04 +01:00
|
|
|
- ./build.sh
|
2022-10-22 16:54:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
# - name: hugo_build
|
|
|
|
# image: alombarte/hugo
|
2021-12-25 11:17:42 +00:00
|
|
|
# when:
|
|
|
|
# branch:
|
|
|
|
# - main
|
|
|
|
# commands:
|
2022-10-22 16:54:37 +01:00
|
|
|
# - git submodule init
|
|
|
|
# - git submodule update
|
|
|
|
# - cd brainsteam
|
|
|
|
# - hugo
|
|
|
|
|
|
|
|
|
|
|
|
# environment:
|
|
|
|
# INPUT_HASHFILE: hashes.sha256
|
|
|
|
# INPUT_HASHTYPE: sha256
|
|
|
|
# INPUT_PROTOCOL: ftp
|
|
|
|
# INPUT_HOST: sv7.byethost7.org
|
|
|
|
# INPUT_DESTINATION: /
|
|
|
|
# INPUT_SOURCE: brainsteam/public
|
|
|
|
# INPUT_USERNAME:
|
|
|
|
# from_secret: FTP_USERNAME
|
|
|
|
# INPUT_PASSWORD:
|
|
|
|
# from_secret: FTP_PASSWORD
|
|
|
|
# FTP_HOSTNAME: sv7.byethost7.org
|
|
|
|
# commands:
|
|
|
|
# - apk add lftp
|
|
|
|
# # - cd brainsteam
|
|
|
|
# # - lftp -e "mirror -R ./public /" -u $FTP_USERNAME,$FTP_PASSWORD $FTP_HOSTNAME
|
|
|
|
# - sh sync.sh
|
|
|
|
# # - name: webmention_check
|
|
|
|
# # image: 3apaxicom/npx
|
|
|
|
# # when:
|
|
|
|
# # branch:
|
|
|
|
# # - main
|
|
|
|
# # commands:
|
|
|
|
# # - npx webmention https://brainsteam.co.uk/index.xml --limit 1 --send
|