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
|
runs-on: static-sites
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
# 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
|
||||||
|
|
||||||
# Install Node.js manually
|
|
||||||
- name: Install Node.js
|
- name: Install Node.js
|
||||||
run: |
|
run: |
|
||||||
# Update package list
|
echo "Installing Node.js..."
|
||||||
apt-get update
|
# Install curl first
|
||||||
|
apt-get update && apt-get install -y curl
|
||||||
# Install Node.js prerequisites
|
# Install Node.js
|
||||||
apt-get install -y curl
|
|
||||||
|
|
||||||
# Install Node.js using their official setup
|
|
||||||
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
|
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
|
||||||
apt-get install -y nodejs
|
apt-get install -y nodejs
|
||||||
|
|
||||||
# Verify installation
|
# Verify installation
|
||||||
node --version
|
node --version
|
||||||
npm --version
|
|
||||||
|
|
||||||
- name: Build site
|
- name: Build site
|
||||||
run: |
|
run: |
|
||||||
# Debug information
|
echo "Building site..."
|
||||||
pwd
|
# Install dependencies
|
||||||
ls -la
|
npm install
|
||||||
|
# Build
|
||||||
# Run build
|
|
||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
- name: Deploy to static-websites
|
- name: Deploy to static-websites
|
||||||
run: |
|
run: |
|
||||||
|
echo "Deploying to static-websites..."
|
||||||
SITE_NAME=${GITHUB_REPOSITORY##*/}
|
SITE_NAME=${GITHUB_REPOSITORY##*/}
|
||||||
DEPLOY_PATH="/static-websites/${SITE_NAME}"
|
DEPLOY_PATH="/static-websites/${SITE_NAME}"
|
||||||
|
|
||||||
# Debug information
|
# Create deployment directory
|
||||||
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
|
|
||||||
mkdir -p "${DEPLOY_PATH}"
|
mkdir -p "${DEPLOY_PATH}"
|
||||||
|
|
||||||
# Copy new files
|
# Copy files
|
||||||
cp -r dist/* "${DEPLOY_PATH}/"
|
cp -r dist/* "${DEPLOY_PATH}/"
|
||||||
|
|
||||||
# Debug permissions
|
# Show results
|
||||||
echo "Final deployment directory contents:"
|
echo "Deployed files:"
|
||||||
ls -la "${DEPLOY_PATH}"
|
ls -la "${DEPLOY_PATH}"
|
||||||
Reference in New Issue
Block a user