Skip to content

Commit

Permalink
Merge pull request #367 from HDFGroup/chogan/automate_docker
Browse files Browse the repository at this point in the history
Move docker files to folder and add CI step to publish docker images
  • Loading branch information
ChristopherHogan committed Mar 3, 2022
2 parents b815c1f + 4f6fa4e commit b395d17
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 2 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/build_and_push_docker_images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build and Push Docker Images
on:
push:
workflow_dispatch:
inputs:
build_docker_images:
description: 'An existing tag for which to build new docker images and publish them to dockerhub'
required: false
default: ''
jobs:
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 by
# using the `build_docker_images` workflow dispatch input.
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
2 changes: 0 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@ on:
description: 'Run the build with tmate debugging enabled'
required: false
default: false

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
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit b395d17

Please sign in to comment.