Build docker image #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# see also | |
# https://docs.github.com/en/actions/publishing-packages/publishing-docker-images#publishing-images-to-github-packages | |
name: Build docker image | |
on: | |
workflow_dispatch: | |
concurrency: | |
group: build_docker-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-docker-image: | |
name: ${{ matrix.image }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
image: ["torch2.0.0-cuda11.7", "torch1.13.0-cuda11.6", "torch1.12.1-cuda11.3", "torch1.9.0-cuda10.2"] | |
steps: | |
# refer to https://github.com/actions/checkout | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Rename | |
shell: bash | |
run: | | |
image=${{ matrix.image }} | |
mv -v ./docker/$image.dockerfile ./Dockerfile | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: k2fsa/icefall:${{ matrix.image }} |