Skip to content

Commit 4ec52d0

Browse files
committed
use token
1 parent 412b502 commit 4ec52d0

File tree

4 files changed

+12
-30
lines changed

4 files changed

+12
-30
lines changed

.github/workflows/clean-site.yml

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,13 @@ 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_ed25519
37-
chmod 600 ~/.ssh/id_ed25519
38-
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
39-
4031
- name: Checkout iotdb-website repository
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
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 }}
5038

5139
- name: Configure Git
5240
run: |

.github/workflows/site-build.yaml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,9 @@ jobs:
4040

4141
- name: Deploy staging website
4242
env:
43-
SSH_KEY: ${{ secrets.IOTDB_WEBSITE_BUILD_SSH }}
43+
IOTDB_WEBSITE_BUILD: ${{ secrets.IOTDB_WEBSITE_BUILD }}
4444
run: |
45-
mkdir -p ~/.ssh
46-
echo "$SSH_KEY" > ~/.ssh/id_ed25519
47-
chmod 600 ~/.ssh/id_ed25519
48-
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
45+
git config --global url."https://asf-ci-deploy:[email protected]/apache/".insteadOf "https://github.com/apache/"
4946
git config --global user.name github-actions
5047
git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
5148
npm run deploy:staging
@@ -100,12 +97,9 @@ jobs:
10097

10198
- name: Deploy website
10299
env:
103-
SSH_KEY: ${{ secrets.IOTDB_WEBSITE_BUILD_SSH }}
100+
IOTDB_WEBSITE_BUILD: ${{ secrets.IOTDB_WEBSITE_BUILD }}
104101
run: |
105-
mkdir -p ~/.ssh
106-
echo "$SSH_KEY" > ~/.ssh/id_ed25519
107-
chmod 600 ~/.ssh/id_ed25519
108-
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
102+
git config --global url."https://asf-ci-deploy:[email protected]/apache/".insteadOf "https://github.com/apache/"
109103
git config --global user.name github-actions
110104
git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
111105
npm run deploy

deploy.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ghpages.publish(
2222
'src/.vuepress/dist',
2323
{
2424
branch: 'asf-site',
25-
repo: 'git@github.com:apache/iotdb-website.git',
25+
repo: 'https://github.com/apache/iotdb-website.git',
2626
message: 'Site checkin for project iotdb-website',
2727
dotfiles: true,
2828
history: false,

deploy_staging.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ghpages.publish(
2222
'src/.vuepress/dist',
2323
{
2424
branch: 'asf-staging',
25-
repo: 'git@github.com:apache/iotdb-website.git',
25+
repo: 'https://github.com/apache/iotdb-website.git',
2626
message: 'Site staging checkin for project iotdb-website',
2727
dotfiles: true,
2828
history: false,

0 commit comments

Comments
 (0)