From a531a0b34dfc064f9ebd7e5f92f2ec8d6e76ed1b Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Wed, 19 Jan 2022 17:56:32 +0100 Subject: [PATCH 1/2] Add automatic push to Dockerhub --- .github/workflows/ci.yml | 48 +++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44f7e4fa..1923898e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,7 @@ jobs: - name: Build tilemaker run: | - mkdir ${{ github.workspace }}\build + mkdir ${{ github.workspace }}\build 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" .. cd ${{ github.workspace }}\build && cmake --build . --config RelWithDebInfo @@ -48,9 +48,9 @@ jobs: ${{ github.workspace }}\build\RelWithDebInfo\tilemaker.exe ${{ github.workspace }}\build\RelWithDebInfo\*.pdb - unix-build: - strategy: - matrix: + unix-build: + strategy: + matrix: include: - os: ubuntu-18.04 triplet: x64-linux @@ -82,10 +82,10 @@ jobs: - name: Build tilemaker run: | - mkdir build - cd build + mkdir build + cd build cmake -DTILEMAKER_BUILD_STATIC=ON -DCMAKE_BUILD_TYPE=Release -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} -DCMAKE_TOOLCHAIN_FILE=${{ matrix.toolchain }} -DCMAKE_CXX_COMPILER=g++ .. - cmake --build . + cmake --build . strip tilemaker - name: Build openmaptiles-compatible mbtiles files of Liechtenstein @@ -115,5 +115,37 @@ jobs: - name: Build openmaptiles-compatible mbtiles files of given area uses: ./ with: - input: ${{ env.AREA }}.osm.pbf + input: ${{ env.AREA }}.osm.pbf output: ${{ env.AREA }}.mbtiles + + dockerhub: + # we only want to push to dockerhub on the main repo + if: github.repository_owner == 'systemed' && github.event_name == 'push' && github.ref == 'refs/heads/master' + + name: Push container image to Dockerhub + + runs-on: ubuntu-latest + needs: Github-Action # this job also uses docker and contains a simple test + + steps: + - name: Check out repository + uses: actions/checkout@v2 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: tilemakerbot + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build container image + run: | + docker build . \ + -t lehrenfried/tilemaker:${{ github.sha }} \ + -t lehrenfried/tilemaker:latest + + - name: Push container image + run: | + docker push \ + lehrenfried/tilemaker:${{ github.sha }} \ + lehrenfried/tilemaker:latest + From ec93db625da7d7da8c7bccff536e20686d6f46db Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Wed, 19 Jan 2022 20:17:17 +0100 Subject: [PATCH 2/2] Use correct syntax for pushing --- .github/workflows/ci.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1923898e..d8dfaa7b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -137,15 +137,13 @@ jobs: username: tilemakerbot password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build container image + - name: Build image run: | docker build . \ -t lehrenfried/tilemaker:${{ github.sha }} \ -t lehrenfried/tilemaker:latest - - name: Push container image - run: | - docker push \ - lehrenfried/tilemaker:${{ github.sha }} \ - lehrenfried/tilemaker:latest + - name: Push image + run: docker push lehrenfried/tilemaker --all-tags +