generated from rochacbruno/flask-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (91 loc) Β· 2.66 KB
/
deploy.yml
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Deploy To Heroku
permissions: write-all
on:
pull_request:
types: [ opened ]
branches: [ main ]
push:
branches: [ main ]
workflow_dispatch:
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Deploy to Heroku
uses: akhileshns/heroku-deploy@v3.12.12
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: "mkpbackend"
heroku_email: "davemcsavvii@gmail.com"
env_file: ".env.production"
- name: Get version
id: get_version
run: |
echo ::set-output name=version::$(cat cookgpt/VERSION)
- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ vars.SENTRY_ORG }}
SENTRY_PROJECT: ${{ vars.SENTRY_PROJECT }}
with:
environment: production
version: "CookGPT@${{ steps.get_version.outputs.version }}"
automerge:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
needs: [deploy]
steps:
- uses: pascalgn/automerge-action@v0.15.6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MERGE_METHOD: merge
MERGE_COMMIT_MESSAGE: ${{ github.event.pull_request.title }}
MERGE_DELETE_BRANCH: false
PULL_REQUEST: ${{ github.event.number }}
PULL_REQUEST_BRANCH: ${{ github.event.pull_request.head.ref }}
upload-code-coverage:
name: Upload code coverage
runs-on: ubuntu-latest
needs: [automerge]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
deploy-doc:
name: Deploy API doc on Bump
runs-on: ubuntu-latest
needs: [automerge]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Deploy API documentation
uses: bump-sh/github-action@v1
with:
doc: "6c3583c2-1448-4ff3-9c8c-eda314881628"
token: ${{ secrets.BUMP_TOKEN }}
file: openapi.json
api-diff:
name: Check API diff on Bump
runs-on: ubuntu-latest
needs: [automerge]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Comment pull request with API diff
uses: bump-sh/github-action@v1
with:
doc: ${{vars.BUMP_DOC_ID}}
token: ${{secrets.BUMP_TOKEN}}
file: openapi.json
command: diff
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}