use examples over example when there is more than one example. #169
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: Build specifications, schemas and comparisions | |
| on: | |
| push: | |
| workflow_dispatch: | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| skip_job: ${{ steps.skip.outputs.skip_job }} | |
| skip_commit: ${{ steps.check-tag.outputs.skip_commit }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Check last commit message | |
| id: commit-message | |
| run: | | |
| echo "COMMIT_MESSAGE=$(git log -1 --pretty=format:'%s')" >> "$GITHUB_ENV" | |
| - id: skip | |
| name: Skip if automated push | |
| if: contains(env.COMMIT_MESSAGE, 'Apply automatic changes') | |
| run: | | |
| echo "Automated commit detected - skipping job" | |
| echo "skip_job=true" >> "$GITHUB_OUTPUT" | |
| - name: Check Branch with Regex | |
| id: check-tag | |
| run: | | |
| regex="^refs/heads/brapi-V[0-9]+\.[0-9]+$" | |
| if [[ "${{ github.ref }}" =~ $regex ]]; then | |
| echo "skip_commit=false" >> "$GITHUB_OUTPUT" | |
| echo "Release branch - WILL commit of generated files" | |
| else | |
| echo "skip_commit=true" >> "$GITHUB_OUTPUT" | |
| echo "Normal branch - Will NOT commit of generated files" | |
| fi | |
| generate: | |
| runs-on: ubuntu-latest | |
| needs: check | |
| if: needs.check.outputs.skip_job != 'true' | |
| steps: | |
| - name: debug | |
| run: | | |
| echo ${{ needs.check.outputs.skip_job }} | |
| echo ${{ needs.check.outputs.skip_commit }} | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ssh-key: ${{ secrets.DEPLOY_KEY }} | |
| - name: Set up Docker Compose | |
| uses: docker/setup-compose-action@v1 | |
| - name: Build and run the Docker image | |
| working-directory: ./docker | |
| run: docker compose run build-docs | |
| - name: Convert compiled specification | |
| working-directory: ./docker | |
| run: docker compose run gen-swagger | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '22' | |
| distribution: 'temurin' | |
| - name: Change wrapper permissions | |
| working-directory: ./generator | |
| run: chmod +x ./gradlew | |
| - name: Copy compiled specification | |
| working-directory: ./generator | |
| run: ./gradlew copyOpenApi | |
| - name: Validate | |
| working-directory: ./generator | |
| run: ./gradlew validate | |
| - name: Generate OpenAPI, GraphQL and OWL | |
| working-directory: ./generator | |
| run: ./gradlew generateAll | |
| - name: Compare OpenAPI | |
| working-directory: ./generator | |
| run: ./gradlew compareAll | |
| - if: needs.check.outputs.skip_commit == 'false' | |
| uses: stefanzweifel/git-auto-commit-action@v5 |