add process docs changes workflow #13
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: Process Branches | ||
| on: | ||
| pull_request: | ||
| branches: | ||
| - master | ||
| workflow_dispatch: | ||
| jobs: | ||
| checkout-docs-repo: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout docs repository | ||
| uses: actions/checkout@v4 | ||
| slurp-branches: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| branch: | ||
| - master | ||
| - release-x.53.x | ||
| - release-x.52.x | ||
| - release-x.51.x | ||
| - release-x.50.x | ||
| - release-x.49.x | ||
| - release-x.48.x | ||
| - release-x.47.x | ||
| - release-x.48.x | ||
| - release-x.46.x | ||
| - release-x.45.x | ||
| - release-x.44.x | ||
| - release-x.43.x | ||
| # TODO: ^ add more release branches ^ | ||
| steps: | ||
| # Clone only a subdirectory from branch {{matrix.branch}} on metabase/metabase using sparse checkout | ||
| # This will be much faster. | ||
| - name: Clone /docs/ from master with sparse checkout | ||
| with: | ||
| ref: ${{ matrix.branch }} | ||
| run: | | ||
|
Check failure on line 41 in .github/workflows/slurp_branches.yml
|
||
| echo ${{ matrix.branch }} | ||
| git clone --depth 1 --branch ${{ matrix.branch }} --filter=blob:none --no-checkout https://github.com/metabase/metabase.git ../metabase-main | ||
| cd ../metabase-main | ||
| git sparse-checkout init --cone | ||
| git sparse-checkout set docs | ||
| git checkout master | ||
| # List all markdown files in the specific subdirectory | ||
| - name: Move markdown files | ||
| run: | | ||
| mkdir -p _docs/${{ matrix.branch }}/ | ||
| cp -r ../metabase-main/docs/. _docs/${{ matrix.branch }}/ | ||
| - name: List markdown files | ||
| run: | | ||
| ls -altr _docs | ||
| # # Optionally, commit and push if changes are expected: | ||
| # - name: Commit changes | ||
| # run: | | ||
| # git config user.name "GitHub Action" | ||
| # git config user.email "action@github.com" | ||
| # git add ${{ matrix.branch }} | ||
| # git commit -m "Processed file for ${{ matrix.branch }}" | ||
| # git push origin ${{ matrix.branch }} | ||
| # env: | ||
| # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||