Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions .github/workflows/clean-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,25 @@ jobs:
echo "❌ Cleanup cancelled: confirmation not provided"
exit 1

- name: Setup SSH
env:
SSH_KEY: ${{ secrets.IOTDB_WEBSITE_BUILD_SSH }}
run: |
mkdir -p ~/.ssh
echo "$SSH_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H github.com >> ~/.ssh/known_hosts

- name: Checkout iotdb-website repository
uses: actions/checkout@v4
with:
repository: apache/iotdb-website
token: ${{ secrets.IOTDB_WEBSITE_BUILD }}
fetch-depth: 0
ref: ${{ github.event.inputs.target_branch == 'both' && 'asf-site' || github.event.inputs.target_branch }}
run: |
git clone --bare git@github.com:apache/iotdb-website.git
cd iotdb-website.git
for branch in asf-site asf-staging; do
git branch -r | grep $branch > /dev/null && echo "Branch $branch exists"
done
cd ..
git clone git@github.com:apache/iotdb-website.git
cd iotdb-website

- name: Configure Git
run: |
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/site-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ jobs:

- name: Deploy staging website
env:
IOTDB_WEBSITE_BUILD: ${{ secrets.IOTDB_WEBSITE_BUILD }}
SSH_KEY: ${{ secrets.IOTDB_WEBSITE_BUILD_SSH }}
run: |
git config --global url."https://asf-ci-deploy:$IOTDB_WEBSITE_BUILD@github.com/apache/".insteadOf "https://github.com/apache/"
mkdir -p ~/.ssh
echo "$SSH_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
git config --global user.name github-actions
git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
npm run deploy:staging
Expand Down Expand Up @@ -97,9 +100,12 @@ jobs:

- name: Deploy website
env:
IOTDB_WEBSITE_BUILD: ${{ secrets.IOTDB_WEBSITE_BUILD }}
SSH_KEY: ${{ secrets.IOTDB_WEBSITE_BUILD_SSH }}
run: |
git config --global url."https://asf-ci-deploy:$IOTDB_WEBSITE_BUILD@github.com/apache/".insteadOf "https://github.com/apache/"
mkdir -p ~/.ssh
echo "$SSH_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
git config --global user.name github-actions
git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
npm run deploy
2 changes: 1 addition & 1 deletion deploy.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ghpages.publish(
'src/.vuepress/dist',
{
branch: 'asf-site',
repo: 'https://github.com/apache/iotdb-website.git',
repo: 'git@github.com:apache/iotdb-website.git',
message: 'Site checkin for project iotdb-website',
dotfiles: true,
history: false,
Expand Down
4 changes: 2 additions & 2 deletions deploy_staging.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ ghpages.publish(
'src/.vuepress/dist',
{
branch: 'asf-staging',
repo: 'https://github.com/apache/iotdb-website.git',
message: 'Site checkin for project iotdb-website',
repo: 'git@github.com:apache/iotdb-website.git',
message: 'Site staging checkin for project iotdb-website',
dotfiles: true,
history: false,
},
Expand Down