-
Notifications
You must be signed in to change notification settings - Fork 3
46 lines (40 loc) · 1.2 KB
/
test-build-api-gateway.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: test-build-api-gateway
env:
DOCKER_HUB_USERNAME: tuana9a
IMAGE_NAME: tuana9a/dkhptd-api-gateway
on:
push:
branches:
- "*"
- "!main"
paths:
- "api-gateway/**"
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build
uses: docker/build-push-action@v4
with:
context: ./api-gateway
file: ./api-gateway/Dockerfile
push: false
tags: |
${{ env.IMAGE_NAME }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Send notification
if: always()
shell: bash
run: |
curl -X POST https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage \
-H "Content-Type: application/json" \
-d "{
\"chat_id\":\"${{ secrets.TELEGRAM_CHAT_ID }}\",
\"disable_notification\":true,
\"text\":\"${{ job.status }} ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\\nimg: ${{ env.IMAGE_NAME }}\"
}"