forked from ToolJet/ToolJet
-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (82 loc) · 3.17 KB
/
tooljet-docker-develop-build.yml
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
name: Tooljet develop docker image build
on:
push:
branches:
- develop
workflow_dispatch:
inputs:
job-to-run:
description: Enter the job name (tooljet-develop-image/tooljet-server-develop-image)
options: ['tooljet-develop-image', 'tooljet-server-develop-image']
required: true
jobs:
tooljet-develop-image:
runs-on: ubuntu-latest
if: |
${{ github.ref == 'refs/heads/develop' }} &&
${{ github.event_name == 'workflow_dispatch' && github.event.inputs.job-to-run == 'tooljet-develop-image' }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: refs/heads/develop
- name: Set DOCKER_CLI_EXPERIMENTAL
run: echo "DOCKER_CLI_EXPERIMENTAL=enabled" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Docker Login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: docker/production.Dockerfile
push: true
tags: tooljet/tooljet-ce:develop
platforms: linux/amd64
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Send Slack Notification on Failure
if: failure()
run: |
message="Job '${{ env.JOB_NAME }}' failed! tooljet/tooljet-ce:develop"
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$message\"}" ${{ secrets.SLACK_WEBHOOK_URL_OPS_CHANNEL }}
tooljet-server-develop-image:
runs-on: ubuntu-latest
if: |
${{ github.ref == 'refs/heads/develop' }} &&
${{ github.event_name == 'workflow_dispatch' && github.event.inputs.job-to-run == 'tooljet-server-develop-image' }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: refs/heads/develop
- name: Set DOCKER_CLI_EXPERIMENTAL
run: echo "DOCKER_CLI_EXPERIMENTAL=enabled" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Docker Login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: docker/server.Dockerfile
push: true
tags: tooljet/tooljet-ce:develop
platforms: linux/amd64
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Send Slack Notification on Failure
if: failure()
run: |
message="Job '${{ env.JOB_NAME }}' failed! tooljet/tooljet-ce:develop"
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$message\"}" ${{ secrets.SLACK_WEBHOOK_URL_OPS_CHANNEL }}