release: version 0.8.0 π #39
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: 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}} |