-
Notifications
You must be signed in to change notification settings - Fork 7
70 lines (67 loc) · 2.04 KB
/
next-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
#
# Copyright (c) 2021 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
name: build-next
on:
workflow_dispatch:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-22.04
steps:
-
name: "Set up QEMU"
uses: docker/setup-qemu-action@v2
-
name: "Set up Docker Buildx"
uses: docker/setup-buildx-action@v2
-
name: "Docker quay.io Login"
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
-
name: Clone source code
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Prepare
id: prep
run: |
set -e
SHORT_SHA1=$(git rev-parse --short HEAD)
echo ::set-output name=short_sha1::${SHORT_SHA1}
echo ::set-output name=version::next
IMAGE=kubernetes-image-puller-operator
echo ::set-output name=image::${IMAGE}
-
name: "Build and push"
uses: docker/build-push-action@v3
with:
context: .
file: ./build/Dockerfile
tags: quay.io/eclipse/${{ steps.prep.outputs.image }}:${{ steps.prep.outputs.version }},quay.io/eclipse/${{ steps.prep.outputs.image }}:${{ steps.prep.outputs.short_sha1 }}
push: true
-
name: Create failure MM message
if: ${{ failure() }}
run: |
echo "{\"text\":\":no_entry_sign: Kubernetes Image puller Operator build has failed: https://github.com/che-incubator/kubernetes-image-puller-operator/actions/workflows/next-build.yml\"}" > mattermost.json
-
name: Send MM message
if: ${{ failure() }}
uses: mattermost/[email protected]
env:
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
MATTERMOST_CHANNEL: eclipse-che-ci
MATTERMOST_USERNAME: che-bot