name: Deploy Static Website on: push: branches: [ main ] workflow_dispatch: jobs: build-and-deploy: runs-on: static-sites steps: # Instead of actions/checkout, we'll use git directly - name: Clone Repository run: | echo "Starting repository clone..." # Clean workspace first rm -rf ./* || true # Clone the repository git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY . git checkout $GITHUB_SHA # Show what we got echo "Repository contents:" ls -la - name: Install Node.js run: | echo "Installing Node.js..." # Install curl first apt-get update && apt-get install -y curl # Install Node.js curl -fsSL https://deb.nodesource.com/setup_18.x | bash - apt-get install -y nodejs # Verify installation node --version - name: Build site run: | echo "Building site..." # Install dependencies npm install # Build npm run build - name: Deploy to static-websites run: | echo "Deploying to static-websites..." SITE_NAME=${GITHUB_REPOSITORY##*/} DEPLOY_PATH="/static-websites/${SITE_NAME}" # Create deployment directory mkdir -p "${DEPLOY_PATH}" # Copy files cp -r dist/* "${DEPLOY_PATH}/" # Show results echo "Deployed files:" ls -la "${DEPLOY_PATH}"