forked from pymc-devs/pymc
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (47 loc) · 1.59 KB
/
docker-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Login to Docker Hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
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 }}