-
Notifications
You must be signed in to change notification settings - Fork 38
101 lines (88 loc) · 2.79 KB
/
build-dev.yml
File metadata and controls
101 lines (88 loc) · 2.79 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Build & Push Docker Image
on:
push:
branches:
- dev
jobs:
send-tg-msg:
name: Send TG message
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Send Telegram message
uses: proDreams/actions-telegram-notifier@main
with:
token: ${{ secrets.TELEGRAM_TOKEN }}
chat_id: ${{ secrets.TELEGRAM_CHAT_ID }}
thread_id: ${{ secrets.TELEGRAM_TOPIC_ID }}
status: pending
notify_fields: 'repo_with_tag,commit,workflow'
title: 'Building docker images.'
build-docker-images:
name: Build ${{ matrix.image.name }}
runs-on: ubuntu-latest
strategy:
matrix:
image:
- name: 'Dev Image'
tag: 'remnawave/node:dev'
dockerfile: 'Dockerfile'
build_args: ''
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22.x'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push ${{ matrix.image.name }}
uses: docker/build-push-action@v3
with:
context: .
file: ${{ matrix.image.dockerfile }}
platforms: linux/amd64
push: true
build-args: ${{ matrix.image.build_args }}
tags: ${{ matrix.image.tag }}
send-finish-tg-msg:
name: Send TG message
needs: [build-docker-images]
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Send Telegram message
uses: proDreams/actions-telegram-notifier@main
with:
token: ${{ secrets.TELEGRAM_TOKEN }}
chat_id: ${{ secrets.TELEGRAM_CHAT_ID }}
thread_id: ${{ secrets.TELEGRAM_TOPIC_ID }}
status: ${{ job.status }}
notify_fields: 'repo_with_tag,commit,workflow'
title: 'Build Dev finished.'
notify-on-error:
runs-on: ubuntu-latest
needs: [build-docker-images]
if: failure()
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Send error notification
uses: proDreams/actions-telegram-notifier@main
with:
token: ${{ secrets.TELEGRAM_TOKEN }}
chat_id: ${{ secrets.TELEGRAM_CHAT_ID }}
thread_id: ${{ secrets.TELEGRAM_TOPIC_ID }}
status: failure
notify_fields: 'repo_with_tag,commit,workflow'
title: 'Build Dev failed.'