This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
name: Build and Deploy Jekyll
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: native
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Checkout
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
run: |
|
||||
git clone --depth 1 https://alois:${GITEA_TOKEN}@git.alocoq.fr/alois/CoqResearch.git .
|
||||
|
||||
- name: Install Ruby and Jekyll
|
||||
run: |
|
||||
apk add --no-cache ruby ruby-dev ruby-bundler build-base
|
||||
bundle install --path vendor/bundle
|
||||
|
||||
- name: Build
|
||||
run: bundle exec jekyll build
|
||||
|
||||
- name: Install kubectl
|
||||
run: |
|
||||
wget -q https://dl.k8s.io/release/v1.31.0/bin/linux/amd64/kubectl
|
||||
chmod +x kubectl
|
||||
mv kubectl /usr/local/bin/kubectl
|
||||
|
||||
- name: Deploy
|
||||
env:
|
||||
KUBE_TOKEN: ${{ secrets.KUBE_TOKEN }}
|
||||
KUBE_SERVER: ${{ secrets.KUBE_SERVER }}
|
||||
run: |
|
||||
unset KUBERNETES_SERVICE_HOST KUBERNETES_SERVICE_PORT
|
||||
kubectl config set-cluster homelab \
|
||||
--server=${KUBE_SERVER} \
|
||||
--insecure-skip-tls-verify=true
|
||||
kubectl config set-credentials deployer --token=${KUBE_TOKEN}
|
||||
kubectl config set-context homelab --cluster=homelab --user=deployer
|
||||
kubectl config use-context homelab
|
||||
POD=$(kubectl get pods -n research -l app=research-nginx -o jsonpath='{.items[0].metadata.name}')
|
||||
kubectl cp _site/. research/${POD}:/usr/share/nginx/html/
|
||||
Reference in New Issue
Block a user