Add new class with rewrited method; small updates #8
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: 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/[email protected] | |
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 }} |