Skip to content

Commit

Permalink
Move docker files to folder and add CI step to publish docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherHogan committed Mar 3, 2022
1 parent b815c1f commit 52d7b8e
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
41 changes: 39 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@ on:
description: 'Run the build with tmate debugging enabled'
required: false
default: false

build_docker_images:
description: 'An existing tag for which to build new docker images and publish them to dockerhub'
required: false
default: ''
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Debug
LOCAL: local

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -92,3 +94,38 @@ jobs:
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
build-docker-images:
if: ${{ github.ref_type == 'tag' || github.event.inputs.build_docker_images }}
runs-on: ubuntu-20.04
strategy:
# user depends on dev depends on deps, so don't run in parallel
max-parallel: 1
matrix:
include:
- dockerfile: deps
tag: hermes-deps
- dockerfile: dev
tag: hermes-dev
- dockerfile: user
tag: hermes
steps:
- name: Checkout
uses: actions/checkout@v2
with:
# Checkout the appropriate tag if we're forcing a docker build
ref: ${{ github.event.input.build_docker_images }}
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build ${{matrix.dockerfile}}.Dockerfile
uses: docker/build-push-action@v2
with:
context: ./
file: ./docker/${{matrix.dockerfile}}.Dockerfile
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: hdfgroup/${{matrix.tag}}:latest
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 52d7b8e

Please sign in to comment.