fix install detox in standalone #20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy site (docs → root) | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - 'docs/**' | |
| # optional: uncomment to avoid deploys on README/license changes, etc. | |
| # - '!README.md' | |
| # - '!.github/**' | |
| workflow_dispatch: | |
| concurrency: | |
| group: deploy-devstart | |
| cancel-in-progress: true | |
| env: | |
| SOURCE_DIR: docs | |
| TARGET_SSH: git@github.com:DevStart-Hub/DevStart-Hub.github.io.git | |
| TARGET_BRANCH: main | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Show repo tree (debug) | |
| run: | | |
| echo "Repository root contents:" | |
| ls -la | |
| echo "Checking ${SOURCE_DIR}:" | |
| ls -la "${SOURCE_DIR}" || echo "No ${SOURCE_DIR} folder found" | |
| echo "pwd: $(pwd)" | |
| - name: Verify source dir exists | |
| run: | | |
| if [ ! -d "${SOURCE_DIR}" ]; then | |
| echo "::error::${SOURCE_DIR} does not exist in this repo." | |
| exit 1 | |
| fi | |
| echo "Contents of ${SOURCE_DIR}:" | |
| ls -la "${SOURCE_DIR}" | |
| - name: Setup SSH (use ONLY our key) | |
| run: | | |
| mkdir -p ~/.ssh | |
| echo "${{ secrets.PUBLISH_KEY }}" > ~/.ssh/id_ed25519 | |
| chmod 600 ~/.ssh/id_ed25519 | |
| ssh-keyscan github.com >> ~/.ssh/known_hosts | |
| cat > ~/.ssh/config <<'EOF' | |
| Host github.com | |
| HostName github.com | |
| User git | |
| IdentityFile ~/.ssh/id_ed25519 | |
| IdentitiesOnly yes | |
| StrictHostKeyChecking accept-new | |
| EOF | |
| chmod 600 ~/.ssh/config | |
| - name: Test SSH connection (non-fatal) | |
| run: ssh -T git@github.com || true | |
| - name: Clone target repo | |
| run: | | |
| git clone --depth 1 "$TARGET_SSH" publish | |
| echo "Target repo contents before cleaning:" | |
| ls -la publish | |
| - name: Clean target root (preserve CNAME/.nojekyll/.github) | |
| run: | | |
| cd publish | |
| find . -mindepth 1 -maxdepth 1 \ | |
| ! -name ".git" \ | |
| ! -name "CNAME" \ | |
| ! -name ".nojekyll" \ | |
| ! -name ".github" \ | |
| ! -name "README.md" \ | |
| ! -name "RenderHub.png" \ | |
| -exec rm -rf {} + | |
| echo "After cleaning:" | |
| ls -la | |
| - name: Copy site files (docs → root) | |
| run: | | |
| echo "Copying ${SOURCE_DIR}/ → publish/" | |
| rsync -av --delete \ | |
| --exclude ".git" \ | |
| --exclude "CNAME" \ | |
| --exclude ".nojekyll" \ | |
| --exclude ".github" \ | |
| --exclude "RenderHub.png" \ | |
| --filter 'protect README.md' \ | |
| "${SOURCE_DIR}/" publish/ | |
| echo "Copy completed" | |
| - name: List published files | |
| run: | | |
| echo "Published files (first 50):" | |
| ls -la publish | head -n 50 | |
| - name: Commit & push | |
| working-directory: publish | |
| run: | | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git config user.name "github-actions[bot]" | |
| git add -A | |
| if git diff --quiet --staged; then | |
| echo "No changes to commit." | |
| exit 0 | |
| fi | |
| echo "Committing changes..." | |
| git commit -m "Deploy from ${GITHUB_REPOSITORY}@${GITHUB_SHA::7} [$(date -u '+%Y-%m-%d %H:%M:%S UTC')]" | |
| echo "Pushing to ${TARGET_BRANCH}..." | |
| git push origin "$TARGET_BRANCH" | |
| echo "Deploy completed successfully!" |