Skip to content

Commit a531a0b

Browse files
Add automatic push to Dockerhub
1 parent 252e7f2 commit a531a0b

File tree

1 file changed

+40
-8
lines changed

1 file changed

+40
-8
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
3131
- name: Build tilemaker
3232
run: |
33-
mkdir ${{ github.workspace }}\build
33+
mkdir ${{ github.workspace }}\build
3434
cd ${{ github.workspace }}\build && cmake -DTILEMAKER_BUILD_STATIC=ON -DVCPKG_TARGET_TRIPLET="x64-windows-static-md" -DCMAKE_TOOLCHAIN_FILE="c:\vcpkg\scripts\buildsystems\vcpkg.cmake" ..
3535
cd ${{ github.workspace }}\build && cmake --build . --config RelWithDebInfo
3636
@@ -48,9 +48,9 @@ jobs:
4848
${{ github.workspace }}\build\RelWithDebInfo\tilemaker.exe
4949
${{ github.workspace }}\build\RelWithDebInfo\*.pdb
5050
51-
unix-build:
52-
strategy:
53-
matrix:
51+
unix-build:
52+
strategy:
53+
matrix:
5454
include:
5555
- os: ubuntu-18.04
5656
triplet: x64-linux
@@ -82,10 +82,10 @@ jobs:
8282
8383
- name: Build tilemaker
8484
run: |
85-
mkdir build
86-
cd build
85+
mkdir build
86+
cd build
8787
cmake -DTILEMAKER_BUILD_STATIC=ON -DCMAKE_BUILD_TYPE=Release -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} -DCMAKE_TOOLCHAIN_FILE=${{ matrix.toolchain }} -DCMAKE_CXX_COMPILER=g++ ..
88-
cmake --build .
88+
cmake --build .
8989
strip tilemaker
9090
9191
- name: Build openmaptiles-compatible mbtiles files of Liechtenstein
@@ -115,5 +115,37 @@ jobs:
115115
- name: Build openmaptiles-compatible mbtiles files of given area
116116
uses: ./
117117
with:
118-
input: ${{ env.AREA }}.osm.pbf
118+
input: ${{ env.AREA }}.osm.pbf
119119
output: ${{ env.AREA }}.mbtiles
120+
121+
dockerhub:
122+
# we only want to push to dockerhub on the main repo
123+
if: github.repository_owner == 'systemed' && github.event_name == 'push' && github.ref == 'refs/heads/master'
124+
125+
name: Push container image to Dockerhub
126+
127+
runs-on: ubuntu-latest
128+
needs: Github-Action # this job also uses docker and contains a simple test
129+
130+
steps:
131+
- name: Check out repository
132+
uses: actions/checkout@v2
133+
134+
- name: Login to DockerHub
135+
uses: docker/login-action@v1
136+
with:
137+
username: tilemakerbot
138+
password: ${{ secrets.DOCKERHUB_TOKEN }}
139+
140+
- name: Build container image
141+
run: |
142+
docker build . \
143+
-t lehrenfried/tilemaker:${{ github.sha }} \
144+
-t lehrenfried/tilemaker:latest
145+
146+
- name: Push container image
147+
run: |
148+
docker push \
149+
lehrenfried/tilemaker:${{ github.sha }} \
150+
lehrenfried/tilemaker:latest
151+

0 commit comments

Comments
 (0)