-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #367 from HDFGroup/chogan/automate_docker
Move docker files to folder and add CI step to publish docker images
- Loading branch information
Showing
5 changed files
with
46 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.