Add slack message sending + upgrade docker build process

This commit is contained in:
Carlos Quintana 2022-05-12 08:54:44 +02:00
parent b3645b33dd
commit cbcd4ea92f
No known key found for this signature in database
GPG Key ID: 15E73DCC410679F8
1 changed files with 22 additions and 4 deletions

View File

@ -102,13 +102,23 @@ jobs:
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v'))
steps:
- name: Publish to Docker Registry
uses: docker/build-push-action@v1
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: simplelogin/app-ci
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
repository: simplelogin/app-ci
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tag_with_ref: true
- name: Build image and publish to Docker Registry
uses: docker/build-push-action@v3
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
- name: Create Sentry release
uses: getsentry/action-release@v1
@ -123,3 +133,11 @@ jobs:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
args: Docker image pushed on ${{ github.ref }}
- name: Post notification to Slack
uses: slackapi/slack-github-action@v1.19.0
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
slack-message: "New tag generated: ${{github.ref}}\nBuild result: ${{ job.status }}"
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}