Update .gitea/workflows/deploy-static.yml
Some checks failed
Deploy Static Website / build-and-deploy (push) Failing after 0s
Some checks failed
Deploy Static Website / build-and-deploy (push) Failing after 0s
This commit is contained in:
@@ -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}"
|
||||
Reference in New Issue
Block a user