Update .gitea/workflows/deploy-static.yml
All checks were successful
Deploy Static Website / build-and-deploy (push) Successful in 2s

This commit is contained in:
2025-01-09 07:33:15 +00:00
parent 597be9f941
commit 857be3e4d1

View File

@@ -10,7 +10,6 @@ jobs:
runs-on: static-sites runs-on: static-sites
steps: steps:
# Instead of actions/checkout, we'll use git directly
- name: Clone Repository - name: Clone Repository
run: | run: |
echo "Starting repository clone..." echo "Starting repository clone..."
@@ -21,28 +20,39 @@ jobs:
git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY . git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY .
git checkout $GITHUB_SHA git checkout $GITHUB_SHA
# Show what we got
echo "Repository contents:" echo "Repository contents:"
ls -la ls -la
- name: Install Node.js - name: Install Node.js
run: | run: |
echo "Installing Node.js..." echo "Installing Node.js using Alpine package manager..."
# Install curl first # Update package list and install required tools
apt-get update && apt-get install -y curl apk update
# Install Node.js # Install Node.js and npm from Alpine packages
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - apk add nodejs npm
apt-get install -y nodejs
# Verify installation # Verify installation
echo "Node.js version:"
node --version node --version
echo "npm version:"
npm --version
- name: Build site - name: Build site
run: | run: |
echo "Building site..." echo "Building site..."
echo "Current directory contents:"
ls -la
# Install dependencies # Install dependencies
echo "Installing npm dependencies..."
npm install npm install
# Build
# Build the site
echo "Running build command..."
npm run build npm run build
echo "Build output:"
ls -la dist/
- name: Deploy to static-websites - name: Deploy to static-websites
run: | run: |
@@ -50,12 +60,11 @@ jobs:
SITE_NAME=${GITHUB_REPOSITORY##*/} SITE_NAME=${GITHUB_REPOSITORY##*/}
DEPLOY_PATH="/static-websites/${SITE_NAME}" DEPLOY_PATH="/static-websites/${SITE_NAME}"
# Create deployment directory echo "Creating deployment directory: ${DEPLOY_PATH}"
mkdir -p "${DEPLOY_PATH}" mkdir -p "${DEPLOY_PATH}"
# Copy files echo "Copying files to deployment directory..."
cp -r dist/* "${DEPLOY_PATH}/" cp -r dist/* "${DEPLOY_PATH}/"
# Show results
echo "Deployed files:" echo "Deployed files:"
ls -la "${DEPLOY_PATH}" ls -la "${DEPLOY_PATH}"