name: Deploy Static Website on: push: branches: [ main ] workflow_dispatch: jobs: build-and-deploy: runs-on: static-sites steps: - uses: actions/checkout@v3 - name: Setup Node.js uses: actions/setup-node@v3 with: node-version: 18 - name: Build site run: npm run build - name: Deploy to static-websites run: | SITE_NAME=${GITHUB_REPOSITORY##*/} DEPLOY_PATH="/static-websites/${SITE_NAME}" # Ensure directory exists mkdir -p "${DEPLOY_PATH}" # Copy new files cp -r dist/* "${DEPLOY_PATH}/"