-
Notifications
You must be signed in to change notification settings - Fork 2
62 lines (57 loc) · 1.79 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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: 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' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/'))
uses: neuro-inc/reuse/.github/workflows/[email protected]
with:
image: platformapi
helm_charts: platform-api platform-api-poller
deploy:
name: Deploy
needs: release
uses: neuro-inc/reuse/.github/workflows/[email protected]
secrets:
tf_api_token: ${{ secrets.TF_API_TOKEN }}
with:
environment: ${{ needs.release.outputs.prerelease == 'true' && 'dev' || 'prod' }}
dev_workspace: ${{ vars.DEV_TFC_WORKSPACE_JSON }}
prod_workspaces: ${{ vars.PROD_TFC_WORKSPACES_JSON }}
variables: |
platform_api_version=${{ needs.release.outputs.version }}