Some checks failed
Deploy Static Website / build-and-deploy (push) Failing after 1s
61 lines
1.5 KiB
YAML
61 lines
1.5 KiB
YAML
name: Deploy Static Website
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: static-sites
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
# Install Node.js manually
|
|
- 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
|
|
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
|
|
npm run build
|
|
|
|
- name: Deploy to static-websites
|
|
run: |
|
|
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
|
|
mkdir -p "${DEPLOY_PATH}"
|
|
|
|
# Copy new files
|
|
cp -r dist/* "${DEPLOY_PATH}/"
|
|
|
|
# Debug permissions
|
|
echo "Final deployment directory contents:"
|
|
ls -la "${DEPLOY_PATH}" |