vlads-notes/.gitea/workflows/publish.yaml
2025-06-22 10:02:50 +01:00

41 lines
1.4 KiB
YAML

name: Gitea Actions Demo
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on: [push]
jobs:
build-quartz:
runs-on: ubuntu-latest
container:
image: node:24.2
steps:
- name: Grab local files
uses: actions/checkout@v4
- name: Clone local copy of Quartz
run: git clone https://k3gtpi.jumpingcrab.com/vlad/quartz-clone.git
- name: Copy notes to content directory
run: cp ./notes/* quartz-clone/content
- name: Build Quartz
run: cd quartz-clone && npm i && npx quartz create && npx quartz build
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: content
path: quartz-clone/public
deploy:
runs-on: ubuntu-latest
needs: build-quartz
steps:
- name: Get artifacts
uses: actions/download-artifact@v3
with:
name: content
path: ./content
- name: Install kubectl
run: curl -LO https://dl.k8s.io/release/v1.33.0/bin/linux/arm64/kubectl && chmod +x kubectl && mv kubectl /usr/bin
- name: Set up cluster access
run: mkdir ~/.kube && echo "${{ secrets.K8S_CONF }}" > ~/.kube/config
- name: Get target pods's name
run: echo "TARGET_POD=$(kubectl get pods -n my-stuff -l app=digital-garden -o json | jq -r .items[0].metadata.name)" >> "$GITHBU_ENV"
- name: Copy contents to PVC
run: kubectl cp content my-stuff/$TARGET_POD:/www/data/