10
10
auto-release :
11
11
runs-on : ubuntu-latest
12
12
if : " !contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
13
+ outputs :
14
+ auto-version : ${{ steps.auto-version.outputs.version }}
13
15
steps :
14
16
- name : Checkout source
15
17
uses : actions/checkout@v2
@@ -32,11 +34,55 @@ jobs:
32
34
- name : Install Python dependencies
33
35
run : python -m pip install build bump2version twine
34
36
37
+ - name : Check whether a release is due
38
+ id : auto-version
39
+ run : |
40
+ version="$(~/auto version)"
41
+ echo "::set-output name=version::$version"
42
+ env :
43
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
44
+
35
45
- name : Create release
36
46
run : ~/auto shipit
37
47
env :
38
48
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
39
49
TWINE_USERNAME : __token__
40
50
TWINE_PASSWORD : ${{ secrets.PYPI_TOKEN }}
41
51
52
+ build-docker :
53
+ runs-on : ubuntu-latest
54
+ needs : auto-release
55
+ if : needs.auto-release.outputs.auto-version != ''
56
+ steps :
57
+ - name : Get tag of latest release
58
+ id : latest-release
59
+ run : |
60
+ latest_tag="$(curl -fsSL https://api.github.com/repos/$GITHUB_REPOSITORY/releases/latest | jq -r .tag_name)"
61
+ echo "::set-output name=tag::$latest_tag"
62
+
63
+ - name : Checkout source
64
+ uses : actions/checkout@v2
65
+ with :
66
+ ref : ${{ steps.latest-release.outputs.tag }}
67
+
68
+ - name : Generate Dockerfile
69
+ run : bash gen-docker-image.sh
70
+ working-directory : utils
71
+
72
+ - name : Build Docker images
73
+ run : |
74
+ docker build \
75
+ -t nipy/heudiconv:master \
76
+ -t nipy/heudiconv:latest \
77
+ -t nipy/heudiconv:${{ steps.latest-release.outputs.tag }} \
78
+ .
79
+
80
+ - name : Push Docker images
81
+ run : |
82
+ docker login -u "$DOCKER_LOGIN" --password-stdin <<<"$DOCKER_TOKEN"
83
+ docker push --all-tags nipy/heudiconv
84
+ env :
85
+ DOCKER_LOGIN : ${{ secrets.DOCKER_LOGIN }}
86
+ DOCKER_TOKEN : ${{ secrets.DOCKER_TOKEN }}
87
+
42
88
# vim:set sts=2:
0 commit comments