|
| 1 | +name: Deploy Documentation |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - enext |
| 7 | + - main |
| 8 | + paths: |
| 9 | + - 'doc/**' |
| 10 | + - '.github/workflows/deploy-docs.yml' |
| 11 | + workflow_dispatch: |
| 12 | + |
| 13 | +permissions: |
| 14 | + contents: read |
| 15 | + pages: write |
| 16 | + id-token: write |
| 17 | + |
| 18 | +concurrency: |
| 19 | + group: "pages" |
| 20 | + cancel-in-progress: false |
| 21 | + |
| 22 | +jobs: |
| 23 | + build: |
| 24 | + runs-on: ubuntu-latest |
| 25 | + steps: |
| 26 | + - name: Checkout |
| 27 | + uses: actions/checkout@v4 |
| 28 | + with: |
| 29 | + submodules: recursive |
| 30 | + |
| 31 | + - name: Set up Python |
| 32 | + uses: actions/setup-python@v5 |
| 33 | + with: |
| 34 | + python-version: '3.11' |
| 35 | + |
| 36 | + - name: Install system dependencies |
| 37 | + run: | |
| 38 | + sudo apt-get update |
| 39 | + sudo apt-get install -y \ |
| 40 | + enchant-2 \ |
| 41 | + libffi-dev \ |
| 42 | + libssl-dev \ |
| 43 | + libxml2-dev \ |
| 44 | + libxslt1-dev \ |
| 45 | + gettext \ |
| 46 | + libfreetype-dev \ |
| 47 | + libjpeg-dev \ |
| 48 | + libpq-dev \ |
| 49 | + build-essential |
| 50 | +
|
| 51 | + - name: Install dependencies |
| 52 | + run: | |
| 53 | + python -m pip install --upgrade pip |
| 54 | + cd doc |
| 55 | + # Run comprehensive installation script |
| 56 | + bash install-all-deps.sh |
| 57 | + env: |
| 58 | + # Skip building C extensions if they fail |
| 59 | + SKIP_BUILD_EXT: "1" |
| 60 | + |
| 61 | + - name: Build main documentation |
| 62 | + run: | |
| 63 | + cd doc |
| 64 | + # Set minimal environment for Django |
| 65 | + export DJANGO_SETTINGS_MODULE=eventyay.config.settings |
| 66 | + export EVENTYAY_CONFIG_FILE=/dev/null |
| 67 | + make html || echo "Main docs build completed with warnings" |
| 68 | + continue-on-error: true |
| 69 | + env: |
| 70 | + DATABASE_URL: "sqlite:////:memory:" |
| 71 | + REDIS_URL: "redis://localhost:6379/0" |
| 72 | + |
| 73 | + - name: Build Talk documentation |
| 74 | + run: | |
| 75 | + cd doc/talk |
| 76 | + export DJANGO_SETTINGS_MODULE=eventyay.config.settings |
| 77 | + export EVENTYAY_CONFIG_FILE=/dev/null |
| 78 | + make html || echo "Talk docs build completed with warnings" |
| 79 | + continue-on-error: true |
| 80 | + env: |
| 81 | + DATABASE_URL: "sqlite:////:memory:" |
| 82 | + REDIS_URL: "redis://localhost:6379/0" |
| 83 | + |
| 84 | + - name: Build Video documentation |
| 85 | + run: | |
| 86 | + cd doc/video |
| 87 | + make html || echo "Video docs build completed with warnings" |
| 88 | + continue-on-error: true |
| 89 | + env: |
| 90 | + SKIP_DJANGO_SETUP: "1" |
| 91 | + |
| 92 | + - name: Consolidate documentation |
| 93 | + run: | |
| 94 | + mkdir -p _site |
| 95 | + # Copy main documentation |
| 96 | + if [ -d doc/_build/html ]; then |
| 97 | + echo "Copying main documentation..." |
| 98 | + cp -r doc/_build/html/* _site/ |
| 99 | + else |
| 100 | + echo "Warning: Main docs not found" |
| 101 | + fi |
| 102 | + # Copy Talk documentation |
| 103 | + if [ -d doc/talk/_build/html ]; then |
| 104 | + echo "Copying Talk documentation..." |
| 105 | + mkdir -p _site/talk |
| 106 | + cp -r doc/talk/_build/html/* _site/talk/ |
| 107 | + else |
| 108 | + echo "Warning: Talk docs not found" |
| 109 | + fi |
| 110 | + # Copy Video documentation |
| 111 | + if [ -d doc/video/_build/html ]; then |
| 112 | + echo "Copying Video documentation..." |
| 113 | + mkdir -p _site/video |
| 114 | + cp -r doc/video/_build/html/* _site/video/ |
| 115 | + else |
| 116 | + echo "Warning: Video docs not found" |
| 117 | + fi |
| 118 | + # Copy CNAME for custom domain (docs.eventyay.com) |
| 119 | + if [ -f doc/CNAME ]; then |
| 120 | + echo "Copying CNAME file..." |
| 121 | + cp doc/CNAME _site/ |
| 122 | + fi |
| 123 | + # Create .nojekyll to prevent GitHub Pages from ignoring files starting with _ |
| 124 | + touch _site/.nojekyll |
| 125 | + # List contents for verification |
| 126 | + echo "Documentation site structure:" |
| 127 | + ls -la _site/ |
| 128 | +
|
| 129 | + - name: Setup Pages |
| 130 | + uses: actions/configure-pages@v4 |
| 131 | + |
| 132 | + - name: Upload artifact |
| 133 | + uses: actions/upload-pages-artifact@v3 |
| 134 | + with: |
| 135 | + path: '_site' |
| 136 | + |
| 137 | + deploy: |
| 138 | + environment: |
| 139 | + name: github-pages |
| 140 | + url: ${{ steps.deployment.outputs.page_url }} |
| 141 | + runs-on: ubuntu-latest |
| 142 | + needs: build |
| 143 | + steps: |
| 144 | + - name: Deploy to GitHub Pages |
| 145 | + id: deployment |
| 146 | + uses: actions/deploy-pages@v4 |
| 147 | + |
0 commit comments