From 597be9f94134fb5db69dc362bbfe4f5e96184355 Mon Sep 17 00:00:00 2001 From: cardosofelipe Date: Thu, 9 Jan 2025 07:32:08 +0000 Subject: [PATCH] Update .gitea/workflows/deploy-static.yml --- .gitea/workflows/deploy-static.yml | 60 +++++++++++++++--------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/.gitea/workflows/deploy-static.yml b/.gitea/workflows/deploy-static.yml index ed68eda..a99db3b 100644 --- a/.gitea/workflows/deploy-static.yml +++ b/.gitea/workflows/deploy-static.yml @@ -10,52 +10,52 @@ jobs: runs-on: static-sites steps: - - uses: actions/checkout@v3 - - # Install Node.js manually + # 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: | - # Update package list - apt-get update - - # Install Node.js prerequisites - apt-get install -y curl - - # Install Node.js using their official setup + 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 - npm --version - + - name: Build site run: | - # Debug information - pwd - ls -la - - # Run build + 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}" - # Debug information - echo "Deploying to: ${DEPLOY_PATH}" - echo "Contents of current directory:" - ls -la - echo "Contents of dist directory:" - ls -la dist || echo "dist directory not found!" - - # Ensure directory exists + # Create deployment directory mkdir -p "${DEPLOY_PATH}" - # Copy new files + # Copy files cp -r dist/* "${DEPLOY_PATH}/" - # Debug permissions - echo "Final deployment directory contents:" + # Show results + echo "Deployed files:" ls -la "${DEPLOY_PATH}" \ No newline at end of file