CI/CD Pipeline #1174
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: CI/CD Pipeline | |
| permissions: {} | |
| on: | |
| schedule: | |
| # run every day at 7:00 AM UTC | |
| - cron: '0 7 * * *' | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| workflow_call: | |
| jobs: | |
| test: | |
| permissions: | |
| contents: read | |
| uses: ./.github/workflows/_test.yml | |
| secrets: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| E2E_REFRESH_TOKEN: ${{ secrets.E2E_REFRESH_TOKEN }} | |
| E2E_ADMIN_USER_PASSWORD: ${{ secrets.E2E_ADMIN_USER_PASSWORD }} | |
| check-generated: | |
| permissions: | |
| contents: read | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version-file: '.node-version' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Regenerate SDK client from vendored spec | |
| run: npm run codegen | |
| - name: Fail if committed client drifted from vendored spec | |
| run: | | |
| if ! git diff --exit-code packages/sdk/src/generated; then | |
| echo "::error::packages/sdk/src/generated is out of sync with packages/sdk/openapi.json. Run 'npm run codegen' and commit the result." | |
| exit 1 | |
| fi | |
| build-docs: | |
| permissions: | |
| contents: write | |
| runs-on: ubuntu-latest | |
| needs: test | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version-file: '.node-version' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build SDK package | |
| run: npm run build:sdk | |
| - name: Generate documentation | |
| run: npm run docs | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./docs | |
| cname: aignostics-platform-sdk.github.io | |
| run-ketryx-report: | |
| needs: test | |
| if: github.ref == 'refs/heads/main' | |
| uses: ./.github/workflows/_report-to-ketryx.yml | |
| with: | |
| build-name: 'pre-release' | |
| secrets: | |
| KETRYX_API_KEY: ${{ secrets.KETRYX_API_KEY }} | |
| codeql: | |
| if: (!contains(github.event.head_commit.message, 'skip:ci')) | |
| uses: ./.github/workflows/_codeql.yml | |
| permissions: | |
| actions: read | |
| contents: read | |
| packages: read | |
| security-events: write | |
| secrets: inherit |