-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into pull_resource
getting html updates from main
- Loading branch information
Showing
98 changed files
with
8,191 additions
and
2,014 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,91 @@ | ||
|
||
# Candace Savonen Apr 2022 | ||
|
||
name: Build Docker Image | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
directory: | ||
required: true | ||
type: string | ||
tag: | ||
required: true | ||
type: string | ||
dockerhubpush: | ||
description: 'Push to Dockerhub?' | ||
required: false | ||
default: 'false' | ||
type: string | ||
secrets: | ||
GH_PAT: | ||
required: true | ||
DOCKERHUB_USERNAME: | ||
required: false | ||
DOCKERHUB_TOKEN: | ||
required: false | ||
|
||
jobs: | ||
|
||
build-docker: | ||
name: Build Docker image | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Verify Dockerfiles changed? | ||
uses: tj-actions/verify-changed-files@v8.8 | ||
id: verify-changed-files | ||
with: | ||
files: | | ||
${{ inputs.directory }}/Dockerfile | ||
${{ inputs.directory }}/github_package_list.tsv | ||
- name: Login as jhudsl-robot | ||
run: | | ||
git config --local --add safe.directory "$GITHUB_WORKSPACE" | ||
git config --local user.email "itcrtrainingnetwork@gmail.com" | ||
git config --local user.name "jhudsl-robot" | ||
# Set up Docker build | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
# Setup layer cache | ||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Set up Docker Build | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Get token | ||
run: echo ${{ secrets.GH_PAT }} > ${{ inputs.directory }}/git_token.txt | ||
|
||
- name: Build Docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
push: false | ||
load: true | ||
context: ${{ inputs.directory }} | ||
file: ${{ inputs.directory }}/Dockerfile | ||
tags: ${{ inputs.tag }} | ||
|
||
# Login to Dockerhub | ||
- name: Login to DockerHub | ||
if: ${{ inputs.dockerhubpush != 'false' }} | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
# Push the Docker image if set to true from a manual trigger | ||
- name: Push Docker image if manual trigger set to true | ||
if: ${{ inputs.dockerhubpush != 'false' }} | ||
run: docker push ${{ inputs.tag }} |
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,32 @@ | ||
# Candace Savonen May 2022 | ||
|
||
name: Manual build of docker image | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
directory: | ||
required: true | ||
type: string | ||
tag: | ||
required: true | ||
type: string | ||
dockerhubpush: | ||
description: 'Push to Dockerhub?' | ||
required: false | ||
default: 'false' | ||
type: string | ||
|
||
jobs: | ||
|
||
build-it: | ||
name: Build docker image on command | ||
uses: ./.github/workflows/docker-test.yml | ||
with: | ||
directory: ${{github.event.inputs.directory}} | ||
tag: ${{github.event.inputs.tag}} | ||
dockerhubpush: ${{github.event.inputs.dockerhubpush}} | ||
secrets: | ||
GH_PAT: ${{ secrets.GH_PAT }} | ||
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | ||
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} |
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
Oops, something went wrong.