CI #3219
This file contains 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] | |
pull_request_target: | |
branches: [master] | |
schedule: | |
- cron: 0 4 * * * | |
jobs: | |
test: | |
if: | | |
(github.event_name == 'push' && github.ref == 'refs/heads/master') || | |
(github.event_name != 'pull_request_target' && !endsWith(github.actor, '[bot]')) || | |
(github.event_name == 'pull_request_target' && endsWith(github.actor, '[bot]')) | |
name: All checks are passed | |
uses: ./.github/workflows/test.yaml | |
approve: | |
name: Approve bot PR | |
runs-on: ubuntu-latest | |
if: github.event_name == 'pull_request_target' | |
needs: test | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- id: generate_token | |
uses: tibdex/github-app-token@v1 | |
with: | |
app_id: ${{ secrets.BOT_APP_ID }} | |
private_key: ${{ secrets.BOT_PRIVATE_KEY }} | |
- name: metadata | |
id: metadata | |
if: github.actor == 'dependabot[bot]' | |
uses: dependabot/[email protected] | |
with: | |
github-token: ${{ steps.generate_token.outputs.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: ${{ steps.generate_token.outputs.token }} | |
release: | |
name: Create release | |
needs: test | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
uses: neuro-inc/reuse/.github/workflows/[email protected] | |
with: | |
image: platform-reports | |
helm_charts: platform-reports | |
deploy_dev: | |
name: Deploy on dev | |
needs: release | |
uses: neuro-inc/reuse/.github/workflows/[email protected] | |
with: | |
helm_charts: platform-reports | |
version: ${{ needs.release.outputs.version }} |