This commit is contained in:
+32
-19
@@ -11,22 +11,35 @@ jobs:
|
||||
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: Deploy
|
||||
run: |
|
||||
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/
|
||||
- name: Build Jekyll in Kubernetes job
|
||||
run: |
|
||||
cat <<'EOF' | kubectl apply -f -
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: jekyll-build
|
||||
namespace: ci
|
||||
spec:
|
||||
backoffLimit: 0
|
||||
template:
|
||||
spec:
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: jekyll
|
||||
image: ruby:3.3-alpine
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- |
|
||||
apk add --no-cache git build-base
|
||||
git clone --depth 1 https://alois:${GITEA_TOKEN}@git.alocoq.fr/alois/CoqResearch.git /work
|
||||
cd /work
|
||||
bundle install
|
||||
bundle exec jekyll build
|
||||
env:
|
||||
- name: GITEA_TOKEN
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: gitea-token
|
||||
key: token
|
||||
EOF
|
||||
Reference in New Issue
Block a user