-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (54 loc) · 1.58 KB
/
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
name: Build
on:
pull_request:
push:
# schedule:
#- cron: "0 * * * *"
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: akerl/[email protected]
- name: Submodules
run: git submodule update --init --recursive
- name: Registry auth
run: ./meta/login.sh
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Update
id: update
run: ./meta/update.rb
if: github.event_name == 'schedule'
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Build container
run: docker build -t new .
if: github.event_name != 'schedule' || steps.update.outputs.updated == 'yes'
- name: Test container
run: ./scripts/test.sh
if: github.event_name != 'schedule' || steps.update.outputs.updated == 'yes'
- name: Publish images
run: ./meta/publish.sh
if: github.event_name == 'push' || steps.update.outputs.updated == 'yes'
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Notify on success
if: success() && github.event_name != 'schedule'
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: akerl/[email protected]
with:
channel_id: ${{ secrets.SLACK_BOT_CHANNEL }}
status: success
color: good
- name: Notify on failure
if: failure()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: akerl/[email protected]
with:
channel_id: ${{ secrets.SLACK_BOT_CHANNEL }}
status: failed
color: danger