Merge pull request #685 from lukemartinlogan/master #386
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
name: Build and Push Docker Images | |
on: | |
push: | |
branches: | |
- master | |
- main | |
- dev | |
workflow_dispatch: | |
branches: | |
- master | |
- main | |
- dev | |
inputs: | |
# build_docker_images: | |
# description: 'If ''true'', force a build of the docker images and push them to dockerhub' | |
# required: false | |
# default: false | |
jobs: | |
build-docker-images: | |
if: ${{ github.ref_type == 'tag' || github.event_name == 'workflow_dispatch' }} | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Cache Hermes deps Docker | |
uses: actions/cache@v3 | |
id: docker-deps-cache | |
with: | |
path: ci/deps/deps.Dockerfile | |
key: docker-${{ hashFiles('docker/deps.Dockerfile') }} | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build and push deps.Dockerfile | |
uses: docker/build-push-action@v4 | |
if: steps.docker-deps-cache.outputs.cache-hit != 'true' | |
with: | |
context: ./ | |
file: ./docker/deps.Dockerfile | |
builder: ${{ steps.buildx.outputs.name }} | |
push: true | |
tags: hdfgroup/hermes-deps:latest | |
# - name: Build and push dev.Dockerfile | |
# uses: docker/build-push-action@v4 | |
# with: | |
# context: ./ | |
# file: ./docker/dev.Dockerfile | |
# builder: ${{ steps.buildx.outputs.name }} | |
# push: true | |
# tags: hdfgroup/hermes-dev:latest | |
# - name: Build and push user.Dockerfile | |
# uses: docker/build-push-action@v4 | |
# with: | |
# context: ./ | |
# file: ./docker/user.Dockerfile | |
# builder: ${{ steps.buildx.outputs.name }} | |
# push: true | |
# tags: hdfgroup/hermes:latest |