| # Licensed to the Apache Software Foundation (ASF) under one |
| # or more contributor license agreements. See the NOTICE file |
| # distributed with this work for additional information |
| # regarding copyright ownership. The ASF licenses this file |
| # to you under the Apache License, Version 2.0 (the |
| # "License"); you may not use this file except in compliance |
| # with the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, |
| # software distributed under the License is distributed on an |
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| # KIND, either express or implied. See the License for the |
| # specific language governing permissions and limitations |
| # under the License |
| name: "Push to DockerHub" |
| |
| on: |
| push: |
| branches: |
| - master |
| |
| jobs: |
| push2DockerHub: |
| runs-on: ubuntu-latest |
| |
| steps: |
| - name: Disk space before |
| run: df . -h |
| - name: Free disk space |
| run: | |
| sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true |
| sudo rm -rf /usr/share/dotnet/ /usr/local/graalvm/ /usr/local/.ghcup/ \ |
| /usr/local/share/powershell /usr/local/share/chromium /usr/local/share/boost \ |
| /usr/local/lib/android /usr/local/lib/node_modules /opt/hostedtoolcache/CodeQL \ |
| /opt/ghc /usr/local/.ghcup || true |
| echo "some directories deleted" |
| sudo apt-get remove --purge -y google-chrome-stable >/dev/null 2>&1 || true |
| sudo apt-get remove --purge -y microsoft-edge-stable >/dev/null 2>&1 || true |
| sudo apt-get remove --purge -y firefox >/dev/null 2>&1 || true |
| sudo apt-get remove --purge -y '^dotnet-.*' >/dev/null 2>&1 || true |
| sudo apt-get remove --purge -y '^llvm-.*' >/dev/null 2>&1 || true |
| sudo apt-get remove --purge -y 'php.*' >/dev/null 2>&1 || true |
| sudo apt-get remove --purge -y '^mongodb-.*' >/dev/null 2>&1 || true |
| sudo apt-get remove --purge -y '^mysql-.*' >/dev/null 2>&1 || true |
| sudo apt-get remove --purge -y '^postgresql-.*' >/dev/null 2>&1 || true |
| sudo apt-get remove --purge -y temurin-* >/dev/null 2>&1 || true |
| sudo apt-get remove --purge -y azure-cli google-cloud-cli* powershell >/dev/null 2>&1 || true |
| sudo apt-get autoremove -y |
| sudo apt-get autoclean -y |
| echo "some packages purged" |
| - name: Disk space after |
| run: df . -h |
| - name: Checkout repository |
| uses: actions/checkout@v7.0.1 |
| - name: Setup Java JDK |
| uses: actions/setup-java@v5 |
| with: |
| distribution: 'temurin' |
| java-version: 25 |
| - name: Setup Maven |
| uses: stCarolas/setup-maven@v5.1 |
| with: |
| maven-version: 3.9.6 |
| - name: Build |
| run: mvn -U -T 1C -P 'skipTests,all,docker' |
| - name: 'Push to DockerHub' |
| run: mvn -f docker/pom.xml docker:push -Ddocker.username=${{secrets.DOCKERHUB_USER}} -Ddocker.password=${{secrets.DOCKERHUB_TOKEN}} |