Skip to content

Commit 54cca4c

Browse files
committed
rebuild website ad heads/main-0-gc405ea4
0 parents  commit 54cca4c

File tree

200 files changed

+43794
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+43794
-0
lines changed

.github/workflows/publish.yml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: publish pages
4+
5+
# Controls when the action will run.
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the main branch
8+
push:
9+
branches: [ main ]
10+
pull_request:
11+
branches: [ main ]
12+
13+
# Allows you to run this workflow manually from the Actions tab
14+
workflow_dispatch:
15+
16+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
17+
jobs:
18+
# This workflow contains a single job called "build"
19+
build:
20+
# The type of runner that the job will run on
21+
runs-on: ubuntu-latest
22+
strategy:
23+
matrix:
24+
python-version: [3.8]
25+
26+
# Steps represent a sequence of tasks that will be executed as part of the job
27+
steps:
28+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
29+
- uses: actions/checkout@v2
30+
31+
# Runs a set of commands using the runners shell
32+
- name: build doc
33+
id: build_doc
34+
run: |
35+
git fetch --unshallow # fetch all history
36+
pip3 install setuptools
37+
pip3 install teedoc
38+
ls -al ~/.local/bin/
39+
export PATH=~/.local/bin/:$PATH
40+
commit_info=`git describe --all --always --long`
41+
out_dir=out`python3 -c 'import json; f=open("site_config.json");config=json.load(f);print(config["site_root_url"])'`
42+
teedoc install
43+
teedoc build
44+
echo "out dir: ${out_dir}"
45+
cp -rf .github $out_dir
46+
echo ::set-output name=out_dir::$out_dir
47+
remote_addr=`git remote get-url --push origin`
48+
echo "remote addr: ${remote_addr}"
49+
cd $out_dir
50+
user_name=`git log -1 --pretty=format:'%an'`
51+
user_email=`git log -1 --pretty=format:'%ae'`
52+
git config --global init.defaultBranch gh-pages
53+
git init
54+
git config user.name ${user_name}
55+
git config user.email ${user_email}
56+
git add -A
57+
git commit -m "rebuild website ad $commit_info"
58+
if [[ "${{ secrets.ACCESS_KEY }}x" == "x" ]]; then
59+
remote_addr=`echo $remote_addr| awk -F'://' '{print $2}'`
60+
remote_addr=https://${user_name}:${{ secrets.GITHUB_TOKEN }}@${remote_addr}
61+
else
62+
SSHPATH="$HOME/.ssh"
63+
rm -rf "$SSHPATH"
64+
mkdir -p "$SSHPATH"
65+
echo "${{ secrets.ACCESS_KEY }}" > "$SSHPATH/id_rsa"
66+
chmod 600 "$SSHPATH/id_rsa"
67+
sudo sh -c "echo StrictHostKeyChecking no >>/etc/ssh/ssh_config"
68+
domain=`echo $remote_addr| awk -F'/' '{print $3}'`
69+
user_org=`echo $remote_addr| awk -F'/' '{print $4}'`
70+
repo=`echo $remote_addr| awk -F'/' '{print $5}'`
71+
remote_addr=git@${domain}:${user_org}/${repo}.git
72+
fi
73+
git remote add origin ${remote_addr}
74+
git push origin HEAD:gh-pages --force
75+
76+
# - name: Deploy 🚀 to github pages
77+
# uses: JamesIves/[email protected]
78+
# with: # more usage visit https://github.com/JamesIves/github-pages-deploy-action
79+
# branch: gh-pages # The branch the action should deploy to.
80+
# folder: ${{ steps.build_doc.outputs.out_dir }} # The folder the action should deploy.
81+
# single-commit: true
82+
# clean: true
83+
# clean-exclude: |
84+
# - .github
85+
86+
# mannually scripts
87+
# cd $out_dir
88+
# git init
89+
# git config user.name ${{ secrets.GIT_NAME }}
90+
# git config user.email ${{ secrets.GIT_EMAIL }}
91+
# git remote add upstream "[email protected]:${{ secrets.REPO }}.git"
92+
# git add -A
93+
# git commit -m "rebuild website ad $commit_info"
94+
# SSHPATH="$HOME/.ssh"
95+
# rm -rf "$SSHPATH"
96+
# mkdir -p "$SSHPATH"
97+
# echo "${{ secrets.ACCESS_KEY }}" > "$SSHPATH/id_rsa"
98+
# chmod 600 "$SSHPATH/id_rsa"
99+
# sudo sh -c "echo StrictHostKeyChecking no >>/etc/ssh/ssh_config"
100+
# git push upstream HEAD:gh-pages --force
101+
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: sync code to gitee
4+
5+
# Controls when the action will run. Triggers the workflow on push or pull request
6+
# events but only for the master branch
7+
on:
8+
push:
9+
branches: [ main ]
10+
pull_request:
11+
branches: [ main ]
12+
13+
# Allows you to run this workflow manually from the Actions tab
14+
workflow_dispatch:
15+
16+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
17+
jobs:
18+
# This workflow contains a single job called "build"
19+
sync_gitee:
20+
name: sync code to gitee
21+
# The type of runner that the job will run on
22+
runs-on: ubuntu-latest
23+
24+
# Steps represent a sequence of tasks that will be executed as part of the job
25+
steps:
26+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
27+
- name: checkout code from github
28+
uses: actions/checkout@v2
29+
30+
# Runs a set of commands using the runners shell
31+
- name: sync source code
32+
run: |
33+
GITEE_GIT_ADDR="[email protected]:teedoc/teedoc.gitee.io.git"
34+
git fetch --unshallow
35+
SSHPATH="$HOME/.ssh"
36+
rm -rf "$SSHPATH"
37+
mkdir -p "$SSHPATH"
38+
echo "${{ secrets.GITEE_SYNC_ACCESSS_KEY }}" > "$SSHPATH/id_rsa"
39+
chmod 600 "$SSHPATH/id_rsa"
40+
sudo sh -c "echo StrictHostKeyChecking no >>/etc/ssh/ssh_config"
41+
git remote add upstream $GITEE_GIT_ADDR
42+
git push upstream main:main --force
43+
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: sync pages to gitee
4+
5+
# Controls when the action will run. Triggers the workflow on push or pull request
6+
# events but only for the master branch
7+
on:
8+
push:
9+
branches: [ gh-pages ]
10+
pull_request:
11+
branches: [ gh-pages ]
12+
13+
# Allows you to run this workflow manually from the Actions tab
14+
workflow_dispatch:
15+
16+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
17+
jobs:
18+
# This workflow contains a single job called "build"
19+
sync_gitee:
20+
name: sync pages to gitee
21+
# The type of runner that the job will run on
22+
runs-on: ubuntu-latest
23+
24+
# Steps represent a sequence of tasks that will be executed as part of the job
25+
steps:
26+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
27+
- name: checkout code from github
28+
uses: actions/checkout@v2
29+
30+
# Runs a set of commands using the runners shell
31+
- name: sync shell cmd
32+
run: |
33+
GITEE_GIT_ADDR="[email protected]:teedoc/teedoc.git"
34+
git fetch --unshallow
35+
git checkout gh-pages
36+
SSHPATH="$HOME/.ssh"
37+
rm -rf "$SSHPATH"
38+
mkdir -p "$SSHPATH"
39+
echo "${{ secrets.GITEE_SYNC_ACCESSS_KEY }}" > "$SSHPATH/id_rsa"
40+
chmod 600 "$SSHPATH/id_rsa"
41+
sudo sh -c "echo StrictHostKeyChecking no >>/etc/ssh/ssh_config"
42+
git remote add upstream $GITEE_GIT_ADDR
43+
git push upstream gh-pages:gh-pages --force
44+
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: sync pages to server
4+
5+
# Controls when the action will run. Triggers the workflow on push or pull request
6+
# events but only for the master branch
7+
on:
8+
push:
9+
branches: [ gh-pages ]
10+
pull_request:
11+
branches: [ gh-pages ]
12+
13+
# Allows you to run this workflow manually from the Actions tab
14+
workflow_dispatch:
15+
16+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
17+
jobs:
18+
# This workflow contains a single job called "build"
19+
sync_gitee:
20+
name: sync pages to server
21+
# The type of runner that the job will run on
22+
runs-on: ubuntu-latest
23+
24+
# Steps represent a sequence of tasks that will be executed as part of the job
25+
steps:
26+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
27+
- name: checkout code from github
28+
uses: actions/checkout@v2
29+
30+
# Runs a set of commands using the runners shell
31+
- name: sync shell cmd
32+
run: |
33+
git fetch --unshallow
34+
git checkout gh-pages
35+
if [[ "${{ secrets.SERVERCHAIN_KEY }}x" != "x" ]]; then curl "https://sctapi.ftqq.com/${{ secrets.SERVERCHAIN_KEY }}.send?title=正在部署teedoc网站到服务器"; else echo "no server chain key"; fi
36+
SSHPATH="$HOME/.ssh"
37+
rm -rf "$SSHPATH"
38+
mkdir -p "$SSHPATH"
39+
echo "${{ secrets.GITEE_SYNC_ACCESSS_KEY_SERVER }}" > "$SSHPATH/id_rsa"
40+
chmod 600 "$SSHPATH/id_rsa"
41+
sudo sh -c "echo StrictHostKeyChecking no >>/etc/ssh/ssh_config"
42+
rsync -avz -c -r --exclude='.git' ./* ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_IP }}:${{ secrets.SERVER_PATH }}/
43+

.nojekyll

Whitespace-only changes.

0 commit comments

Comments
 (0)