-
-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (38 loc) · 1.37 KB
/
release_docker.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
name: Build and Push Docker Image
on:
push:
# Trigger only when changes are made in these specific files or directories
paths:
- "setup.py"
- "README.md"
- "openml_tensorflow/**"
- "docs/Examples/**"
- "docker/Dockerfile"
- "docs/Docker reference/Docker.md"
workflow_dispatch: # allows manual trigger to the workflow
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/#-action@v2
with:
username: ${{ secrets.ORG_DOCKERHUB_USERNAME }}
password: ${{ secrets.ORG_DOCKERHUB_TOKEN }}
- name: Build Docker Image
run: |
docker build -t openml/openml-tensorflow:latest -f docker/Dockerfile .
- name: Push Docker Image
run: |
docker push openml/openml-tensorflow:latest
- name: Update Docker Hub Overview
run: |
# Extract the content of Docker.md
DESCRIPTION=$(cat docs/Docker\ reference/Docker.md)
# Authenticate with Docker Hub and update description
curl -X PATCH https://hub.docker.com/v2/repositories/openml/openml-tensorflow/ \
-H "Authorization: Bearer ${{ secrets.ORG_DOCKERHUB_TOKEN }}" \
-H "Content-Type: application/json" \
-d "{\"full_description\": \"$DESCRIPTION\"}"