Process en branch #38
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
| # The name of this GH action | |
| name: Process en branch | |
| # Defines when this action should be run | |
| on: | |
| # Run on any Push | |
| push: | |
| branches: | |
| - en | |
| # Allow manual triggering | |
| workflow_dispatch: | |
| jobs: | |
| # A task that processes OpenAPI files from the en branch | |
| process-en-branch: | |
| # We run this on the latest ubuntu | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| strategy: | |
| matrix: | |
| node-version: [24.x] | |
| steps: | |
| - name: Check out api schemas from en branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: refs/heads/en | |
| path: openapi | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Check out scripts from main branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: refs/heads/main | |
| path: main | |
| sparse-checkout: | | |
| .github/scripts | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Install script dependencies | |
| working-directory: main/.github/scripts | |
| run: npm install | |
| - name: Run add-code-samples script | |
| working-directory: main/.github/scripts | |
| run: npm run add-code-samples -- "../../../openapi" "openapi.*\\.json" | |
| - name: Run edit | |
| run: mkdir test && echo "README" > test/README.md | |
| - name: Copy openapi directory to test directory | |
| run: cp -r openapi test | |
| - name: Push test directory to en-api-docs branch | |
| uses: s0/[email protected] | |
| env: | |
| REPO: self | |
| BRANCH: en-api-docs | |
| FOLDER: test | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |