diff --git a/.github/workflows/crosspalne.yml b/.github/workflows/crosspalne.yml new file mode 100644 index 0000000..1eafc7e --- /dev/null +++ b/.github/workflows/crosspalne.yml @@ -0,0 +1,40 @@ +name: To-To-To Crossplane +on: + schedule: + - cron: "15 3 * * *" + workflow_dispatch: +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Crossplane To-To-To + run: | + set -x + + source libs/aliyun.sh + install_aliyun_ossutil + + initdir=`pwd` + + source ${initdir}/libs/common.sh + + cat ${initdir}/sed/* > ${initdir}/toto.sed + + for project in "https://github.com/crossplane/docs.git" + do + + uuid=`date "+%s%N"` + workdir="${initdir}/tmp/${uuid}" + mkdir -p $workdir + + git clone $project $workdir + ls $workdir + + find ./webs -name toto.sh -exec /bin/bash {} $workdir $initdir \; + + src=`cat ${workdir}/ret-data|grep -v ^$|head -n 1|awk -F'&' '{print $1}'` + dest=`cat ${workdir}/ret-data|grep -v ^$|head -n 1|awk -F'&' '{print $2}'` + + ./ossutil --access-key-id ${{ secrets.ALIYUN_CYG_OSS_AK }} --access-key-secret ${{ secrets.ALIYUN_CYG_OSS_SK }} --endpoint ${{ secrets.ALIYUN_CYG_OSS_ENDPOINT }} --region ${{ secrets.ALIYUN_CYG_OSS_REGION }} cp -fr $src $dest + done \ No newline at end of file diff --git a/all.list b/all.list index c13bfc7..6528b2e 100644 --- a/all.list +++ b/all.list @@ -18,4 +18,5 @@ https://github.com/coredns/coredns.io.git https://github.com/jaegertracing/documentation.git https://github.com/grpc/grpc.io.git https://github.com/dapr/docs.git -https://github.com/emissary-ingress/emissary-ingress.dev.git \ No newline at end of file +https://github.com/emissary-ingress/emissary-ingress.dev.git +https://github.com/crossplane/docs.git \ No newline at end of file diff --git a/push.list b/push.list index 5c88a0c..6d12c5a 100644 --- a/push.list +++ b/push.list @@ -1 +1 @@ -https://github.com/emissary-ingress/emissary-ingress.dev.git \ No newline at end of file +https://github.com/crossplane/docs.git \ No newline at end of file diff --git a/webs/crossplane/toto.sh b/webs/crossplane/toto.sh new file mode 100644 index 0000000..a32b850 --- /dev/null +++ b/webs/crossplane/toto.sh @@ -0,0 +1,43 @@ +workdir=$1 +initdir=$2 + +source ${initdir}/libs/common.sh + +before_crossplane_website(){ + install_hugo_v145 + npm install + + + # 添加网站访问统计 + echo '' >> ./themes/geekboot/layouts/partials/favicons.html + +} + +after_crossplane_website(){ + + mkdir output + hugo \ + --destination ./output \ + --cleanDestinationDir \ + --minify \ + --gc \ + --enableGitInfo \ + --baseURL https://crossplane.cncfstack.com + +} + +save_return(){ + ls -lha + pwd + echo "${workdir}/output&oss://cncfstack-crossplane" > ${workdir}/ret-data +} + + +cd $workdir +if cat .git/config |grep '/crossplane/docs.git' ;then + echo "=============================================> 匹配到 crossplane" + before_crossplane_website + after_crossplane_website + find_and_sed_v2 "./output" + save_return +fi diff --git a/webs/emissary-ingress/toto.sh b/webs/emissary-ingress/toto.sh index e7bbd72..1ebe687 100644 --- a/webs/emissary-ingress/toto.sh +++ b/webs/emissary-ingress/toto.sh @@ -13,7 +13,7 @@ before_emissary-ingress_website(){ echo "------------------" ls -lhathemes/docsy/ # 添加网站访问统计 - echo '' >> ./themes/docsy/layouts/partials/favicons.html + echo '' >> ./themes/docsy/layouts/partials/favicons.html }