Create build branch to sync #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 Documentation to Wiki | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| sync-wiki: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v2 | |
| - name: Setup Julia | |
| uses: julia-actions/setup-julia@v1 | |
| with: | |
| version: '1.9' | |
| - name: Install Julia dependencies | |
| run: julia -e 'using Pkg; Pkg.add("ArgParse")' | |
| - name: Process markdown files | |
| run: julia scripts/preprocess.jl --input ./ --output ./build | |
| - name: Commit processed files to wiki-build branch | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| # Create orphan branch (no history needed) | |
| git checkout --orphan wiki-build | |
| # Remove all tracked files from staging | |
| git rm -rf . | |
| # Add only the build directory contents | |
| cp -r build/* . | |
| git add . | |
| # Commit | |
| git commit -m "Auto-generated wiki content from ${{ github.sha }}" | |
| # Force push (replaces previous build) | |
| git push origin wiki-build --force | |
| - name: Sync docs to wiki | |
| uses: newrelic/wiki-sync-action@main | |
| with: | |
| branch: wiki-build | |
| source: . | |
| destination: wiki | |
| token: ${{ secrets.TOKEN }} |