CI: docker image workflow

build and push whenever the docker file has changed. Push with two tags, latest, and commit's hash
This commit is contained in:
Ayoub Benaissa
2021-07-22 14:05:24 +01:00
committed by Quentin Bourgerie
parent 4504f090c5
commit 812268000c

31
.github/workflows/docker.yml vendored Normal file
View File

@@ -0,0 +1,31 @@
name: Docker image
on:
push:
paths:
- builders/Dockerfile.mlir-env
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build_publish:
name: Build & Publish the Docker image
runs-on: ubuntu-latest
env:
IMAGE: qbozama/mlir
steps:
- uses: actions/checkout@v2
- name: build
run: docker build -t $IMAGE -f builders/Dockerfile.mlir-env .
- name: login
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_LOGIN }} --password-stdin
- name: tag and publish
run: |
docker tag $IMAGE $IMAGE:${{ github.sha }}
docker push $IMAGE:latest
docker push $IMAGE:${{ github.sha }}