Skip to content

Commit

Permalink
Merge pull request #2124 from spechub/2119_regularly_update_Hets_dock…
Browse files Browse the repository at this point in the history
…er_image

add CI job for docker publishing
  • Loading branch information
tillmo authored Sep 14, 2023
2 parents 8fd7828 + de235a7 commit 5d7c575
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 1 deletion.
70 changes: 70 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion Docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:18.04
FROM ubuntu:20.04

ENV LANG C.UTF-8

Expand Down

0 comments on commit 5d7c575

Please sign in to comment.