Skip to content

docker-image

docker-image #57

Workflow file for this run

name: docker-image
on:
release:
types:
- created
env:
CONTAINER_NAME: build-test
jobs:
build-container:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- name: Login to Docker Hub
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
with:
images: |
name=pymc/pymc,enable=true
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and load image
uses: docker/build-push-action@32945a339266b759abcbdc89316275140b0fc960
with:
context: .
file: scripts/Dockerfile
load: true
tags: ${{ env.CONTAINER_NAME }}
- name: Test importing pymc
run: |
docker run --rm ${{ env.CONTAINER_NAME }} conda run -n pymc-dev python -c 'import pymc;print(pymc.__version__)'
- name: Build and push
uses: docker/build-push-action@32945a339266b759abcbdc89316275140b0fc960
with:
context: .
push: true
file: scripts/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}