-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
591 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Git | ||
.git | ||
.github | ||
.gitignore | ||
.gitattributes | ||
|
||
# Docker | ||
docker-compose.yml | ||
docker-compose.yaml | ||
**/Dockerfile | ||
**/Containerfile* | ||
.docker | ||
.dockerignore | ||
|
||
# Meta | ||
README.md | ||
LICENSE | ||
|
||
# Configuration | ||
changelog.json | ||
*.db |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Code Quality | ||
|
||
on: | ||
push: | ||
branches: [ feature/* ] | ||
|
||
jobs: | ||
code_quality: | ||
runs-on: ubuntu-latest | ||
name: Checks with black and isort | ||
container: python:3.9 | ||
|
||
steps: | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Run script | ||
run: pip install -r requirements.txt | ||
|
||
- name: Black check | ||
run: black --check . | ||
|
||
- name: Isort check | ||
run: isort --check . | ||
|
||
- name: Notify if failure | ||
if: ${{ failure() }} | ||
uses: appleboy/telegram-action@master | ||
with: | ||
to: ${{ secrets.TELEGRAM_CHAT }} | ||
token: ${{ secrets.TELEGRAM_TOKEN }} | ||
format: html | ||
message: | | ||
<b>!!! FAILED !!!</b> | ||
<b>Failed job:</b> https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
See changes: https://github.com/${{ github.repository }}/commit/${{ github.sha }} | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Ignore and notify | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
paths-ignore: | ||
- 'README.md' | ||
- '.gitignore' | ||
- '.dockerignore' | ||
- 'changelog.json' | ||
|
||
jobs: | ||
|
||
telegram: | ||
runs-on: ubuntu-latest | ||
name: Notify after update | ||
steps: | ||
|
||
- name: Notify after released image | ||
uses: appleboy/telegram-action@master | ||
with: | ||
to: ${{ secrets.TELEGRAM_CHAT }} | ||
token: ${{ secrets.TELEGRAM_TOKEN }} | ||
format: html | ||
message: | | ||
${{ github.actor }} created commit: | ||
<b>WorkFlows:</b> <a href="https://github.com/${{ github.repository }}/actions/">ActionsList</a> | ||
Repository: ${{ github.repository }} | ||
Branch: ${{ github.ref }} | ||
<b>Something were changed</b> | ||
See changes: https://github.com/${{ github.repository }}/commit/${{ github.sha }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
name: Build | ||
|
||
on: | ||
pull_request: | ||
branches: [ develop ] | ||
paths-ignore: | ||
- 'README.md' | ||
- '.gitignore' | ||
- '.dockerignore' | ||
- 'changelog.json' | ||
|
||
jobs: | ||
|
||
prepare: | ||
name: Prepare env & label | ||
runs-on: ubuntu-latest | ||
outputs: | ||
get_current_tag: ${{ steps.set_current_tag_id.outputs.current_tag }} | ||
steps: | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Bump version and push tag | ||
id: tag_version | ||
uses: mathieudutour/github-tag-action@v6.0 | ||
with: | ||
github_token: ${{ secrets.REPOS_TOKEN }} | ||
|
||
- name: Set label develop | ||
uses: actions-ecosystem/action-add-labels@v1 | ||
with: | ||
labels: develop | ||
|
||
- name: Add author as assignees | ||
uses: actions-ecosystem/action-add-assignees@v1 | ||
with: | ||
assignees: ${{ github.actor }} | ||
github_token: ${{ secrets.REPOS_TOKEN }} | ||
|
||
- name: Set tag version to output | ||
id: set_current_tag_id | ||
run: echo "::set-output name=current_tag::${{ steps.tag_version.outputs.new_tag }}" | ||
|
||
- name: Notify if failure | ||
if: ${{ failure() }} | ||
uses: appleboy/telegram-action@master | ||
with: | ||
to: ${{ secrets.TELEGRAM_CHAT }} | ||
token: ${{ secrets.TELEGRAM_TOKEN }} | ||
format: html | ||
message: | | ||
<b>!!! FAILED !!!</b> | ||
<b>Failed job:</b> https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
See changes: https://github.com/${{ github.repository }}/commit/${{ github.sha }} | ||
build: | ||
runs-on: ubuntu-latest | ||
needs: prepare | ||
name: Publish on DockerHub | ||
|
||
steps: | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_TOKEN }} | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build and push | ||
id: push_image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: true | ||
file: Containerfile | ||
tags: ${{ secrets.DOCKER_USERNAME }}/epistolary:${{ needs.prepare.outputs.get_current_tag }} | ||
|
||
- name: Notify if failure | ||
if: ${{ failure() }} | ||
uses: appleboy/telegram-action@master | ||
with: | ||
to: ${{ secrets.TELEGRAM_CHAT }} | ||
token: ${{ secrets.TELEGRAM_TOKEN }} | ||
format: html | ||
message: | | ||
<b>!!! FAILED !!!</b> | ||
<b>Failed job:</b> https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
See changes: https://github.com/${{ github.repository }}/commit/${{ github.sha }} | ||
telegram: | ||
runs-on: ubuntu-latest | ||
name: Notification | ||
needs: [ prepare, build ] | ||
|
||
steps: | ||
- name: Notify telegram message after Packaging | ||
uses: appleboy/telegram-action@master | ||
with: | ||
to: ${{ secrets.TELEGRAM_CHAT }} | ||
token: ${{ secrets.TELEGRAM_TOKEN }} | ||
format: html | ||
message: | | ||
${{ github.actor }} created commit: | ||
<b>WorkFlows:</b> <a href="https://github.com/${{ github.repository }}/actions">ActionsList</a> | ||
Commit with tag: ${{ needs.prepare.outputs.get_current_tag }} | ||
Repository: ${{ github.repository }} | ||
Branch: ${{ github.ref }} | ||
<b>Pushed image:</b> <code>docker pull ${{ secrets.DOCKER_USERNAME }}/epistolary:${{ needs.prepare.outputs.get_current_tag }}</code> | ||
See changes: https://github.com/${{ github.repository }}/commit/${{ github.sha }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
name: Release | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
paths-ignore: | ||
- 'README.md' | ||
- '.gitignore' | ||
- '.dockerignore' | ||
- 'changelog.json' | ||
|
||
jobs: | ||
|
||
prepare: | ||
name: Prepare env & label | ||
runs-on: ubuntu-latest | ||
outputs: | ||
get_current_tag: ${{ steps.set_current_tag_id.outputs.current_tag }} | ||
steps: | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Bump version and push tag | ||
id: tag_version | ||
uses: mathieudutour/github-tag-action@v6.0 | ||
with: | ||
github_token: ${{ secrets.REPOS_TOKEN }} | ||
|
||
- name: Set label release | ||
uses: actions-ecosystem/action-add-labels@v1 | ||
with: | ||
labels: release | ||
|
||
- name: Add author as assignees | ||
uses: actions-ecosystem/action-add-assignees@v1 | ||
with: | ||
assignees: ${{ github.actor }} | ||
github_token: ${{ secrets.REPOS_TOKEN }} | ||
|
||
- name: Set tag version to output | ||
id: set_current_tag_id | ||
run: echo "::set-output name=current_tag::${{ steps.tag_version.outputs.new_tag }}" | ||
|
||
- name: Notify if failure | ||
if: ${{ failure() }} | ||
uses: appleboy/telegram-action@master | ||
with: | ||
to: ${{ secrets.TELEGRAM_CHAT }} | ||
token: ${{ secrets.TELEGRAM_TOKEN }} | ||
format: html | ||
message: | | ||
<b>!!! FAILED !!!</b> | ||
<b>Failed job:</b> https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
See changes: https://github.com/${{ github.repository }}/commit/${{ github.sha }} | ||
release: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
needs: prepare | ||
outputs: | ||
get_release_url: ${{ steps.set_release_url.outputs.release_url }} | ||
steps: | ||
|
||
- name: Build Changelog | ||
id: github_release | ||
uses: mikepenz/release-changelog-builder-action@v3 | ||
with: | ||
configuration: "changelog.json" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.REPOS_TOKEN }} | ||
with: | ||
tag_name: ${{ needs.prepare.outputs.get_current_tag }} | ||
release_name: Release ${{ needs.prepare.outputs.get_current_tag }} | ||
body: ${{ steps.github_release.outputs.changelog }} | ||
|
||
- name: Set Release URL | ||
id: set_release_url | ||
run: echo "::set-output name=release_url::${{ steps.create_release.outputs.upload_url }}" | ||
|
||
- name: Notify if failure | ||
if: ${{ failure() }} | ||
uses: appleboy/telegram-action@master | ||
with: | ||
to: ${{ secrets.TELEGRAM_CHAT }} | ||
token: ${{ secrets.TELEGRAM_TOKEN }} | ||
format: html | ||
message: | | ||
<b>!!! FAILED !!!</b> | ||
<b>Failed job:</b> https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
See changes: https://github.com/${{ github.repository }}/commit/${{ github.sha }} | ||
build: | ||
name: Publish on DockerHub | ||
needs: [ prepare, release ] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_TOKEN }} | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build and push | ||
id: push_image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: true | ||
file: Containerfile | ||
tags: ${{ secrets.DOCKER_USERNAME }}/epistolary:latest | ||
|
||
- name: Notify if failure | ||
if: ${{ failure() }} | ||
uses: appleboy/telegram-action@master | ||
with: | ||
to: ${{ secrets.TELEGRAM_CHAT }} | ||
token: ${{ secrets.TELEGRAM_TOKEN }} | ||
format: html | ||
message: | | ||
<b>!!! FAILED !!!</b> | ||
<b>Failed job:</b> https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
See changes: https://github.com/${{ github.repository }}/commit/${{ github.sha }} | ||
telegram: | ||
runs-on: ubuntu-latest | ||
name: Notification | ||
needs: [ prepare, release, build ] | ||
|
||
steps: | ||
- name: Notify telegram message after Released | ||
uses: appleboy/telegram-action@master | ||
with: | ||
to: ${{ secrets.TELEGRAM_CHAT }} | ||
token: ${{ secrets.TELEGRAM_TOKEN }} | ||
format: html | ||
message: | | ||
${{ github.actor }} created commit: | ||
<b>WorkFlows:</b> <a href="https://github.com/${{ github.repository }}/actions">ActionsList</a> | ||
Commit with tag: ${{ needs.prepare.outputs.get_current_tag }} | ||
Repository: ${{ github.repository }} | ||
Branch: ${{ github.ref }} | ||
<b>Pushed image:</b> <code>docker pull ${{ secrets.DOCKER_USERNAME }}/epistolary:latest</code> | ||
See changes: https://github.com/${{ github.repository }}/commit/${{ github.sha }} | ||
<b>Release URL:</b> https://github.com/${{ github.repository }}/releases/tag/${{ needs.prepare.outputs.get_current_tag }} | ||
See changes: https://github.com/${{ github.repository }}/commit/${{ github.sha }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,3 +127,6 @@ dmypy.json | |
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# Secret file | ||
settings.toml |
Oops, something went wrong.