CI #5490
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 | |
| on: | |
| push: | |
| branches: [master] | |
| tags: ['v*'] | |
| pull_request: | |
| branches: [master] | |
| schedule: | |
| - cron: 0 4 * * * | |
| jobs: | |
| test: | |
| name: All checks are passed | |
| uses: ./.github/workflows/test.yaml | |
| approve: | |
| name: Approve bot PR | |
| runs-on: ubuntu-latest | |
| if: endsWith(github.actor, '[bot]') | |
| needs: test | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: metadata | |
| id: metadata | |
| if: github.actor == 'dependabot[bot]' | |
| uses: dependabot/fetch-metadata@v2 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Enable auto-merge for bot PRs | |
| run: gh pr merge --auto --squash --delete-branch "$PR_URL" | |
| env: | |
| PR_URL: ${{ github.event.pull_request.html_url }} | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| discover-charts: | |
| name: Discover Helm charts | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
| runs-on: ubuntu-latest | |
| outputs: | |
| helm_charts: ${{ steps.discover.outputs.helm_charts }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Collect chart paths | |
| id: discover | |
| shell: bash | |
| run: | | |
| set -eo pipefail | |
| charts=$(find charts -maxdepth 1 -mindepth 1 -type d -printf '%f\n' | sort) | |
| echo "$charts" | |
| { | |
| echo "helm_charts<<EOF" | |
| echo "$charts" | |
| echo "EOF" | |
| } >> "$GITHUB_OUTPUT" | |
| release: | |
| name: Create release | |
| needs: | |
| - test | |
| - discover-charts | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
| uses: neuro-inc/reuse/.github/workflows/release-service.yaml@v25.12.1 | |
| with: | |
| helm_chart_repo_prefix: /platform-compute | |
| helm_charts: ${{ needs.discover-charts.outputs.helm_charts }} | |
| deploy: | |
| name: Deploy | |
| needs: release | |
| uses: neuro-inc/reuse/.github/workflows/deploy-service.yaml@v25.12.1 | |
| secrets: | |
| tf_api_token: ${{ secrets.TF_API_TOKEN }} | |
| with: | |
| environment: prod | |
| dev_workspace: ${{ vars.DEV_TFC_WORKSPACE_JSON }} | |
| prod_workspaces: ${{ vars.PROD_TFC_WORKSPACES_JSON }} | |
| variables: | | |
| platform_version=${{ needs.release.outputs.version }} |