Skip to content

Merge pull request #866 from threefoldtech/ci/check-doc-commands #888

Merge pull request #866 from threefoldtech/ci/check-doc-commands

Merge pull request #866 from threefoldtech/ci/check-doc-commands #888

name: manual.dev.grid.tf
on:
push:
branches: [ development ]
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: pushing latest change on manual.dev.grid.tf
uses: appleboy/ssh-action@master
with:
host: manual.dev.grid.tf
username: ${{ secrets.TF_USER }}
key: ${{ secrets.TF_SECRET }}
port: ${{ secrets.TF_PORT }}
script: |
cd websites/www2/info_grid
git checkout development
git log -1
git fetch
git reset --hard origin/development
# Install or update Node.js to v20 (required for glob 11.0.1)
echo "Setting up Node.js v20 for Docusaurus and glob..."
# Find nvm and use it if available
if [ -d "$HOME/.nvm" ]; then
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
# Install Node.js 20 LTS if not already installed
nvm install 20 || true
# Use Node.js 20
nvm use 20
else
# Alternative: Install Node.js directly
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
fi
# Verify Node.js version
node -v
# Install Yarn if not available
if ! which yarn > /dev/null; then
echo "Yarn not found, installing..."
npm install -g yarn
fi
# Create a temporary .yarnrc file to use resolutions for glob
echo '{"resolutions": {"glob": "^8.1.0"}}' > .yarnrc.json
# Use the Makefile to build the site (now updated to use Yarn)
make build
# Move the build directory content to docs for web server
echo "Moving build content to docs directory for web server..."
# Backup existing docs if it exists
if [ -d "docs" ]; then
echo "Backing up existing docs directory..."
mv docs docs.bak.$(date +%Y%m%d%H%M%S)
fi
# Create docs directory and copy build content
mkdir -p docs
cp -r build/* docs/
echo "Content moved from build to docs directory successfully"
# Clean up the build directory to save space
echo "Cleaning up build directory..."
rm -rf build
echo "Build directory removed"
echo "Build completed. Web server should serve from the docs directory."