diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000000..ae1f36d49a --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,70 @@ +# Build hets docker image +name: Docker + +env: + HETS_LIB_REPO: https://github.com/spechub/Hets-lib.git + HETS_PPA: http://ppa.launchpad.net/hets/hets/ubuntu + +on: + push: + branches: + - master + pull_request: + paths: + - 'Docker/**' + # NOTE: Can be triggered via WebUI, if this file is on the _default_ branch, + # only. However, triggering via Rest Api should work! + workflow_dispatch: + inputs: + tags: + description: 'Test image' + +# Run this workflow for the latest commit in a branch, only. I.e. if there is +# any instance for an older commit still running, stop it and kill its jobs. +concurrency: + group: pr-docker-${{ github.head_ref }} + cancel-in-progress: true + +jobs: + + job_1: + # takes ~ ??? + name: Publish docker image + # If a job doesn't get picked up for hours, the cause could be, that the + # specified platform is not supported anymore. In this case one will not get + # any hint, what's goin wrong - it just sits in the queue and wait for a + # runner forever (or until it gets kicked by a github cleanup job). See also + # https://github.com/actions/runner-images/issues/6002 + # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources + runs-on: ubuntu-20.04 + steps: + - name: Dump GitHub context + env: + GITHUB_CTX: ${{ toJSON(github) }} + MY_ENV: ${{ toJSON(env) }} + RUNNER_CTX: ${{ toJSON(runner) }} + run: | + printf "github:\n$GITHUB_CTX\n" + printf "env:\n$MY_ENV\n" + printf "env:\n$RUNNER_CTX\n" + df -h + printf "Tags: ${{ github.event.inputs.tags }}\n" + + # NOTE: any file mutation in the steps that precede the build step will + # be ignored, including processing of the .dockerignore file since + # the context is based on the Git reference. + - name: Docker Buildx Setup + uses: docker/setup-buildx-action@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: "{{defaultContext}}:Docker" + push: true + tags: ${{ secrets.DOCKER_HUB_USERNAME }}/hets:latest diff --git a/Docker/Dockerfile b/Docker/Dockerfile index c6c045f965..f557b9b1e7 100644 --- a/Docker/Dockerfile +++ b/Docker/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 ENV LANG C.UTF-8