This repository has been archived on 2024-10-01. You can view files and clone it, but cannot push or open issues or pull requests.
badhouseplants-net-old/.drone.yml
Allen Languor 682de643fb Build static and use nginx instead of the full hugo server (#8)
This pull request will close #4

Hugo server needs about 800mb of memory just to do what nginx can with a way smaller requirements, so it makes sense to stop using `hugo` for serving statics
2023-02-17 14:48:16 +00:00

89 lines
2.3 KiB
YAML

---
# ----------------------------------------------
# -- Build the site and push it to the registry
# ----------------------------------------------
kind: pipeline
type: kubernetes
name: Build badhouseplants.net
trigger:
branch:
- main
event:
- push
steps:
- name: Publish the Helm chart
image: alpine/helm
environment:
GITEA_TOKEN:
from_secret: GITEA_TOKEN
commands:
- helm plugin install https://github.com/chartmuseum/helm-push
- helm package chart -d chart-package
- helm repo add --username allanger --password $GITEA_TOKEN allanger-charts https://git.badhouseplants.net/api/packages/allanger/helm
- helm cm-push "./chart-package/$(ls chart-package)" allanger-charts
- name: Init git submodules with themes
image: alpine/git
commands:
- git submodule update --init --recursive
- name: Get static content
image: rclone/rclone:latest
environment:
RCLONE_CONFIG_CONTENT:
from_secret: RCLONE_CONFIG_CONTENT
RCLONE_CONFIG: /tmp/rclone.conf
commands:
- echo "$RCLONE_CONFIG_CONTENT" > $RCLONE_CONFIG
- rclone copy -P badhouseplants-public:/badhouseplants-static static
- name: Build and push the docker image
image: plugins/docker
settings:
registry: git.badhouseplants.net
username: allanger
password:
from_secret: GITEA_TOKEN
repo: git.badhouseplants.net/allanger/badhouseplants-net
tags: latest
depends_on:
- Init git submodules with themes
- Get static content
---
# ----------------------------------------------
# -- Upload a newer version of my CV
# ----------------------------------------------
kind: pipeline
type: kubernetes
name: CV Builder
trigger:
branch:
- main
event:
- push
steps:
- name: Build the CV
image: ghcr.io/puppeteer/puppeteer
commands:
- cp -R ./content/cv/* $HOME
- cd $HOME
- npm install md-to-pdf
- npx md-to-pdf index.md
- mkdir $DRONE_WORKSPACE/cv
- mv index.pdf $DRONE_WORKSPACE/cv/n.rodionov.pdf
- name: Upload the CV
image: rclone/rclone:latest
environment:
RCLONE_CONFIG_CONTENT:
from_secret: RCLONE_CONFIG_CONTENT_PRIVATE
RCLONE_CONFIG: /tmp/rclone.conf
commands:
- echo "$RCLONE_CONFIG_CONTENT" > $RCLONE_CONFIG
- rclone copy -P $DRONE_WORKSPACE/cv badhouseplants-minio:/public-download