2020-05-20 03:48:47 +08:00
|
|
|
# This workflow will run whenever there is a change to the version of LLVM the project is based on
|
|
|
|
# It will create a new Docker image for the TravisCI build and push it to Docker Hub
|
|
|
|
# This image contains the prereqs for building onnx-mlir including a precompiled copy of the appropriate
|
|
|
|
# LLVM and MLIR code.
|
2020-07-08 00:42:05 +08:00
|
|
|
#
|
|
|
|
# To make this work on your fork you need to enable the github workflow and set a personal access token for your
|
|
|
|
# docker hub account in the github secrets.
|
|
|
|
# When the action succeeds it will put the prereq image in your docker hub repository.
|
2020-05-20 03:48:47 +08:00
|
|
|
|
|
|
|
name: Build Docker Prereq Image
|
|
|
|
|
|
|
|
# Run this workflow when there is a change to clone-mlir.sh (that implies a new version of LLVM is being used)
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths:
|
|
|
|
- 'utils/clone-mlir.sh'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
# This workflow contains a single job called "build"
|
|
|
|
build:
|
|
|
|
# The type of runner that the job will run on
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
# Steps represent a sequence of tasks that will be executed as part of the job
|
|
|
|
steps:
|
|
|
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
|
|
|
- uses: actions/checkout@v2
|
2020-07-08 00:42:05 +08:00
|
|
|
- name: build image on fork
|
|
|
|
if: ! endsWith(github.ref, '/master')
|
|
|
|
env:
|
|
|
|
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}
|
|
|
|
run: |
|
|
|
|
docker build --tag $GITHUB_ACTOR/onnx-mlir-llvmimage:initial -f $GITHUB_WORKSPACE/.github/workflows/prereq.Dockerfile $GITHUB_WORKSPACE/utils
|
|
|
|
docker login -u $GITHUB_ACTOR -p "$DOCKER_HUB_TOKEN"
|
|
|
|
docker push $GITHUB_ACTOR/onnx-mlir-llvmimage:initial
|
|
|
|
- name: build image on master
|
|
|
|
if: endsWith(github.ref, '/master')
|
2020-05-20 03:48:47 +08:00
|
|
|
run: |
|
|
|
|
docker build --tag onnxmlirczar/onnx-mlir-llvmimage:initial -f $GITHUB_WORKSPACE/.github/workflows/prereq.Dockerfile $GITHUB_WORKSPACE/utils
|
2020-07-10 03:32:06 +08:00
|
|
|
docker login -u onnxmlirczar -p "$DOCKER_HUB_TOKEN"
|
2020-07-08 00:42:05 +08:00
|
|
|
docker push onnxmlirczar/onnx-mlir-llvmimage:initial
|