File tree Expand file tree Collapse file tree 4 files changed +31
-13
lines changed
Expand file tree Collapse file tree 4 files changed +31
-13
lines changed Original file line number Diff line number Diff line change @@ -28,13 +28,25 @@ jobs:
2828 echo "❌ Cleanup cancelled: confirmation not provided"
2929 exit 1
3030
31+ - name : Setup SSH
32+ env :
33+ SSH_KEY : ${{ secrets.IOTDB_WEBSITE_BUILD_SSH }}
34+ run : |
35+ mkdir -p ~/.ssh
36+ echo "$SSH_KEY" > ~/.ssh/id_rsa
37+ chmod 600 ~/.ssh/id_rsa
38+ ssh-keyscan -H github.com >> ~/.ssh/known_hosts
39+
3140 - name : Checkout iotdb-website repository
32- uses : actions/checkout@v4
33- with :
34- repository : apache/iotdb-website
35- token : ${{ secrets.IOTDB_WEBSITE_BUILD }}
36- fetch-depth : 0
37- ref : ${{ github.event.inputs.target_branch == 'both' && 'asf-site' || github.event.inputs.target_branch }}
41+ run : |
42+ git clone --bare [email protected] :apache/iotdb-website.git 43+ cd iotdb-website.git
44+ for branch in asf-site asf-staging; do
45+ git branch -r | grep $branch > /dev/null && echo "Branch $branch exists"
46+ done
47+ cd ..
48+ git clone [email protected] :apache/iotdb-website.git 49+ cd iotdb-website
3850
3951 - name : Configure Git
4052 run : |
Original file line number Diff line number Diff line change 4040
4141 - name : Deploy staging website
4242 env :
43- IOTDB_WEBSITE_BUILD : ${{ secrets.IOTDB_WEBSITE_BUILD }}
43+ SSH_KEY : ${{ secrets.IOTDB_WEBSITE_BUILD_SSH }}
4444 run : |
45- git config --global url."https://asf-ci-deploy:[email protected] /apache/".insteadOf "https://github.com/apache/" 45+ mkdir -p ~/.ssh
46+ echo "$SSH_KEY" > ~/.ssh/id_rsa
47+ chmod 600 ~/.ssh/id_rsa
48+ ssh-keyscan -H github.com >> ~/.ssh/known_hosts
4649 git config --global user.name github-actions
4750 git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
4851 npm run deploy:staging
@@ -97,9 +100,12 @@ jobs:
97100
98101 - name : Deploy website
99102 env :
100- IOTDB_WEBSITE_BUILD : ${{ secrets.IOTDB_WEBSITE_BUILD }}
103+ SSH_KEY : ${{ secrets.IOTDB_WEBSITE_BUILD_SSH }}
101104 run : |
102- git config --global url."https://asf-ci-deploy:[email protected] /apache/".insteadOf "https://github.com/apache/" 105+ mkdir -p ~/.ssh
106+ echo "$SSH_KEY" > ~/.ssh/id_rsa
107+ chmod 600 ~/.ssh/id_rsa
108+ ssh-keyscan -H github.com >> ~/.ssh/known_hosts
103109 git config --global user.name github-actions
104110 git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
105111 npm run deploy
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ ghpages.publish(
2222 'src/.vuepress/dist' ,
2323 {
2424 branch : 'asf-site' ,
25- repo : 'https:// github.com/ apache/iotdb-website.git' ,
25+ repo : 'git@ github.com: apache/iotdb-website.git' ,
2626 message : 'Site checkin for project iotdb-website' ,
2727 dotfiles : true ,
2828 history : false ,
Original file line number Diff line number Diff line change @@ -22,8 +22,8 @@ ghpages.publish(
2222 'src/.vuepress/dist' ,
2323 {
2424 branch : 'asf-staging' ,
25- repo : 'https:// github.com/ apache/iotdb-website.git' ,
26- message : 'Site checkin for project iotdb-website' ,
25+ repo : 'git@ github.com: apache/iotdb-website.git' ,
26+ message : 'Site staging checkin for project iotdb-website' ,
2727 dotfiles : true ,
2828 history : false ,
2929 } ,
You can’t perform that action at this time.
0 commit comments