feat(relations): add new relations module with UUID v5 handler for ke… #47
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: Docker Publish | |
on: | |
push: | |
branches: [ main ] | |
tags: [ 'v*.*.*' ] | |
pull_request: | |
branches: [ main ] | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} | |
TELEGRAM_CI_ID: ${{ secrets.TELEGRAM_CI_ID }} | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=sha | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build-args: | | |
GITHUB_TOKEN=${{ secrets.GH_TOKEN }} | |
- name: Send Telegram notification on success | |
if: success() | |
run: | | |
curl -s -X POST https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage \ | |
-d chat_id=${TELEGRAM_CI_ID} \ | |
-d parse_mode=html \ | |
-d text="✅ <b><a href='${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}'>${GITHUB_REPOSITORY}</a></b>%0A%0ABranch: <b>${GITHUB_REF_NAME}</b>%0ACommit: <a href='${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}'>${GITHUB_SHA::8}</a>%0A%0AAvailable tags:%0A<code>${{ steps.meta.outputs.tags }}</code>%0A%0A<a href='${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}'>View workflow details</a>" | |
- name: Send Telegram notification on failure | |
if: failure() | |
run: | | |
curl -s -X POST https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage \ | |
-d chat_id=${TELEGRAM_CI_ID} \ | |
-d parse_mode=html \ | |
-d text="❌ <b><a href='${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}'>${GITHUB_REPOSITORY}</a></b>%0A%0ABranch: <b>${GITHUB_REF_NAME}</b>%0ACommit: <a href='${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}'>${GITHUB_SHA::8}</a>%0A%0A<a href='${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}'>View error logs</a>" |