fix: www deploy #4
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: Sync to WWW Repository | |
| on: | |
| push: | |
| paths: | |
| - 'raw/**' | |
| - 'scripts/split_reference.py' | |
| - '.github/workflows/sync-www.yml' | |
| branches: | |
| - main | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout docs | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Split Reference | |
| run: python3 scripts/split_reference.py | |
| - name: Checkout www | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: zenc-lang/www | |
| token: ${{ secrets.WEBSITE_REPO_TOKEN }} | |
| path: www | |
| fetch-depth: 0 | |
| - name: Sync content and site infrastructure | |
| run: | | |
| # Create targets | |
| mkdir -p www/docs.zenc-lang.org/content/tour/ | |
| mkdir -p www/docs.zenc-lang.org/translations/ | |
| mkdir -p www/docs.zenc-lang.org/templates/ | |
| # Sync docs content | |
| cp -r reference/* www/docs.zenc-lang.org/content/tour/ | |
| # Sync site infrastructure (overwriting if exists) | |
| cp -r site/config.toml www/docs.zenc-lang.org/ | |
| cp -r site/translations/* www/docs.zenc-lang.org/translations/ | |
| cp -r site/templates/* www/docs.zenc-lang.org/templates/ | |
| - name: Commit and Push | |
| run: | | |
| cd www | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add docs.zenc-lang.org/ | |
| if git diff --staged --quiet; then | |
| echo "No changes to commit" | |
| else | |
| git commit -m "docs/site: Sync language reference and i18n infrastructure" | |
| git push | |
| fi |