fix(install): ignore ext-dom requirement in production composer install #110
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: Git Autodeploy CI | |
| on: | |
| push: | |
| branches: ['*'] | |
| pull_request: | |
| branches: ['*'] | |
| jobs: | |
| build_and_run_tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Validate composer.json and composer.lock | |
| run: composer validate --strict | |
| - name: Cache Composer packages | |
| id: composer-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php- | |
| - name: Install dependencies | |
| run: composer install --prefer-dist --no-progress | |
| - name: Run test suite | |
| run: composer run-script test | |
| lint-php-code: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Lint PHP code (Dry Run) | |
| run: ./linter/lint.sh --dry-run | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: [build_and_run_tests, lint-php-code] | |
| if: success() | |
| steps: | |
| - name: Self-Update All Instances | |
| env: | |
| AUTODEPLOY_URL: ${{ vars.AUTODEPLOY_URL }} | |
| run: | | |
| # Convert comma-separated URLs into array | |
| IFS=',' read -ra URLS <<< "$AUTODEPLOY_URL" | |
| echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" | |
| echo "🔄 Self-updating ${#URLS[@]} instance(s)" | |
| echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" | |
| echo "" | |
| # Array to track results | |
| declare -a RESULTS | |
| declare -a FAILED_INSTANCES | |
| ALL_SUCCESS=true | |
| # Iterate over each URL | |
| for i in "${!URLS[@]}"; do | |
| URL="${URLS[$i]}" | |
| # Remove whitespace | |
| URL=$(echo "$URL" | xargs) | |
| INSTANCE_NUM=$((i + 1)) | |
| echo "┌─────────────────────────────────────────────┐" | |
| echo "│ Instance $INSTANCE_NUM/${#URLS[@]}: $URL" | |
| echo "└─────────────────────────────────────────────┘" | |
| # Call /self-update endpoint | |
| response=$(curl -X GET \ | |
| -s -o "response_${i}.txt" -w "%{http_code}" \ | |
| --max-time 60 \ | |
| "https://${URL}/self-update" 2>&1 || echo "000") | |
| # Check the result | |
| if [ "$response" -ge 200 ] && [ "$response" -lt 400 ]; then | |
| echo "✅ SUCCESS - Self-update completed (HTTP $response)" | |
| RESULTS[$i]="✅ $URL - Self-updated (HTTP $response)" | |
| else | |
| echo "❌ FAILED - Self-update failed (HTTP $response)" | |
| RESULTS[$i]="❌ $URL - Self-update failed (HTTP $response)" | |
| FAILED_INSTANCES+=("$URL") | |
| ALL_SUCCESS=false | |
| fi | |
| # Show response preview | |
| echo "" | |
| echo "Response preview:" | |
| if [ -f "response_${i}.txt" ]; then | |
| head -n 20 "response_${i}.txt" | sed 's/^/ /' | |
| fi | |
| echo "" | |
| echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" | |
| echo "" | |
| done | |
| # Final summary | |
| echo "" | |
| echo "╔═══════════════════════════════════════════════╗" | |
| echo "║ SELF-UPDATE SUMMARY ║" | |
| echo "╚═══════════════════════════════════════════════╝" | |
| echo "" | |
| for result in "${RESULTS[@]}"; do | |
| echo " $result" | |
| done | |
| echo "" | |
| if [ "$ALL_SUCCESS" = true ]; then | |
| echo "🎉 All instances self-updated successfully!" | |
| exit 0 | |
| else | |
| echo "⚠️ Some self-updates failed:" | |
| for failed in "${FAILED_INSTANCES[@]}"; do | |
| echo " - $failed" | |
| done | |
| exit 1 | |
| fi |