Skip to content

[in-progress, do-not-merge] upgrade docker build and github pipeline #114

[in-progress, do-not-merge] upgrade docker build and github pipeline

[in-progress, do-not-merge] upgrade docker build and github pipeline #114

Workflow file for this run

name: Docker Image CI
on:
schedule:
- cron: '37 2 * * 1'
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
type: choice
options:
- info
- warning
- debug
pull_request: #for debugging purposes
#branches: [ "master" ]
jobs:
enable_build:
#if: github.repository == 'kaldi-asr/kaldi'
if: if: github.repository_owner == 'jtrmal' || github.repository_owner == 'kaldi-asr'

Check failure on line 23 in .github/workflows/docker-images.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/docker-images.yml

Invalid workflow file

You have an error in your yaml syntax on line 23
runs-on: ubuntu-latest
outputs:
enabled: ${{ steps.set-enabled.outputs.enabled }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set enabled
id: set-enabled
run: |
set -x
echo $(git rev-list --after="1 week" ${{ github.sha }})
if test -z $(git rev-list --after="1 week" ${{ github.sha }} | tail -n 1) ; then
enabled=false
else
enabled=true
fi
echo "enabled: $enabled"
echo "enabled=${enabled}" >> $GITHUB_OUTPUT
docker-buildx-gpu:
needs: enable_build
if: needs.enable_build.outputs.enabled == 'true' || github.event_name == 'push' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
install: true
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Inspect builder
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
- name: Build and push
run: |
cd docker/ubuntu18.04-cuda10.0/
docker build --push --tag kaldiasr/kaldi:gpu-latest --tag kaldiasr/kaldi:gpu-ubuntu18.04-cuda10.0 --tag kaldiasr/kaldi:gpu-ubuntu18.04-cuda10.0-$(date +%F) .
docker-buildx-cpu:
needs: enable_build
if: needs.enable_build.outputs.enabled == 'true' || github.event_name == 'push' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
install: true
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Inspect builder
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
- name: Build and push
run: |
cd docker/debian12-cpu/
docker build \
--tag kaldiasr/kaldi:latest \
--tag kaldiasr/kaldi:cpu-latest \
--tag kaldiasr/kaldi:cpu-debian12 \
--tag kaldiasr/kaldi:cpu-debian12-$(date +%F) .