Skip to content

Commit

Permalink
Add tests for buildx
Browse files Browse the repository at this point in the history
  • Loading branch information
bluemellophone committed Dec 10, 2021
1 parent 5cb61b1 commit e11cfb7
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 6 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/docker-publish-buildx.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build and upload Docker (Buildx)

on:
push:
branches:
- main

jobs:
devops:
name: Docker image build
runs-on: ubuntu-latest

strategy:
matrix:
images:
- wbia-base wbia-provision wbia

steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
name: Install Python
with:
python-version: 3.8

# Log into image registries
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: wildmebot
password: ${{ secrets.WBIA_WILDMEBOT_DOCKER_HUB_TOKEN }}

- name: Create Buildx context
run: |
docker buildx create --name multi-arch-builder --use
# Build images
- name: Build images
run: |
# Build Image
cd devops/
bash build.sh ${{ matrix.images }}
23 changes: 17 additions & 6 deletions .github/workflows/docker-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ jobs:
# Build Image
cd devops/
bash build.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
Expand All @@ -56,26 +59,34 @@ jobs:

- name: Push to Docker Hub (Nightly)
if: github.event_name == 'schedule'
run: bash devops/publish.sh -t nightly ${{ matrix.images }}
run: bash devops/publish.sh -t nightly ${PUBLISH_IMAGES}
env:
PUBLISH_IMAGES: ${{ matrix.images }} wildbook-ia

- name: Push to GitHub Packages (Nightly)
if: github.event_name == 'schedule'
run: bash devops/publish.sh -t nightly -r ghcr.io/wildmeorg/wildbook-ia ${{ matrix.images }}
run: bash devops/publish.sh -t nightly -r ghcr.io/wildmeorg/wildbook-ia ${PUBLISH_IMAGES}
env:
PUBLISH_IMAGES: ${{ matrix.images }} wildbook-ia

- name: Push to Docker Hub (Latest)
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} ${{ matrix.images }}
bash devops/publish.sh -t latest ${{ matrix.images }}
bash devops/publish.sh -t ${VERSION} ${PUBLISH_IMAGES}
bash devops/publish.sh -t latest ${PUBLISH_IMAGES}
env:
PUBLISH_IMAGES: ${{ matrix.images }} wildbook-ia

# Push containers out to container registries
- name: Push to GitHub Packages (Latest)
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 ${{ matrix.images }}
bash devops/publish.sh -t latest -r ghcr.io/wildmeorg/wildbook-ia ${{ matrix.images }}
bash devops/publish.sh -t ${VERSION} -r ghcr.io/wildmeorg/wildbook-ia ${PUBLISH_IMAGES}
bash devops/publish.sh -t latest -r ghcr.io/wildmeorg/wildbook-ia ${PUBLISH_IMAGES}
env:
PUBLISH_IMAGES: ${{ matrix.images }} wildbook-ia

# Notify status in Slack
- name: Slack Notification
Expand Down

0 comments on commit e11cfb7

Please sign in to comment.