-
Notifications
You must be signed in to change notification settings - Fork 21
112 lines (97 loc) · 3.56 KB
/
docker-publish-arm64.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
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
102
103
104
105
106
107
108
109
110
111
112
name: Build and upload Docker (ARM64)
on:
push:
tags:
- v*
jobs:
devops:
name: Docker image build
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
matrix:
images:
- wbia-base wbia-provision wbia
steps:
- uses: actions/checkout@v2
if: github.event_name == 'schedule'
with:
ref: main
- uses: actions/checkout@v2
if: github.event_name != 'schedule'
- uses: docker/setup-qemu-action@v1
name: Set up QEMU
id: qemu
with:
image: tonistiigi/binfmt:latest
platforms: all
- uses: docker/setup-buildx-action@v1
name: Set up Docker Buildx
id: buildx
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: 3.8
# Build images
- name: Build images
run: |
# Build Image
cd devops/
bash buildx.arm64.sh ${{ matrix.images }}
env:
# The wildbook-ia image is built at the same time as wbia, it is an alias
BUILD_IMAGES: ${{ matrix.images }}
# Log into image registries
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: wildmebot
password: ${{ secrets.WBIA_WILDMEBOT_DOCKER_HUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_PAT }}
- name: Push to Docker Hub (ARM64)
if: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') }}
run: |
VERSION=$(echo ${GITHUB_REF} | sed 's#.*/v##')
bash devops/publish.sh -t ${VERSION} ${PUBLISH_IMAGES}
bash devops/publish.sh -t arm64 ${PUBLISH_IMAGES}
env:
PUBLISH_IMAGES: ${{ matrix.images }} wildbook-ia
# Push containers out to container registries
- name: Push to GitHub Packages (ARM64)
if: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') }}
run: |
VERSION=$(echo ${GITHUB_REF} | sed 's#.*/v##')
bash devops/publish.sh -t ${VERSION} -r ghcr.io/wildmeorg/wildbook-ia ${PUBLISH_IMAGES}
bash devops/publish.sh -t arm64 -r ghcr.io/wildmeorg/wildbook-ia ${PUBLISH_IMAGES}
env:
PUBLISH_IMAGES: ${{ matrix.images }} wildbook-ia
# Notify status in Slack
- name: Slack Notification
if: ${{ failure() && github.event_name == 'schedule' }}
uses: rtCamp/action-slack-notify@master
env:
SLACK_CHANNEL: ia-development
SLACK_COLOR: '#FF0000'
SLACK_ICON: https://avatars.slack-edge.com/2020-03-02/965719891842_db87aa21ccb61076f236_44.png
SLACK_MESSAGE: 'Nightly Docker build failed :sob:'
SLACK_USERNAME: "Nightly"
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
# Notify status in Slack
- name: Slack Notification
if: ${{ failure() && github.event_name != 'schedule' }}
uses: rtCamp/action-slack-notify@master
env:
SLACK_CHANNEL: ia-development
SLACK_COLOR: '#FF0000'
SLACK_ICON: https://avatars.slack-edge.com/2020-03-02/965719891842_db87aa21ccb61076f236_44.png
SLACK_MESSAGE: 'ARM64 Docker build failed :sob:'
SLACK_USERNAME: "ARM64"
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}