Manual Docker Container Build #17
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: Manual Docker Container Build | |
on: | |
workflow_dispatch: | |
inputs: | |
push_to_where: | |
description: 'Type either "dockerhub" or "github" to push to the respective registry' | |
default: 'github' | |
required: true | |
type: string | |
env: | |
MAIN_REPO: ncsa/standalone-smm-analytics | |
jobs: | |
# ---------------------------------------------------------------------- | |
# DOCKER BUILD | |
# ---------------------------------------------------------------------- | |
docker: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
name: | |
- autophrase | |
- histogram | |
- check_screen_name | |
- classification_predict | |
- classification_train | |
- classification_split | |
- collect_reddit_comment | |
- crimson_hexagon_monitors | |
- image_crawler | |
- name_entity_recognition | |
- network_analysis | |
- preprocessing | |
- screen_name_prompt | |
- sentiment_analysis | |
- topic_modeling | |
- clowder_create_collection | |
- clowder_create_dataset | |
- clowder_create_space | |
- clowder_list | |
- clowder_upload_file | |
include: | |
- name: autophrase | |
dockerfile: Dockerfile | |
workdir: containerized_analytics/smile/autophrase | |
docker_repo_tag: socialmediamacroscope/autophrase | |
github_repo_tag: ncsa/autophrase | |
- name: histogram | |
dockerfile: Dockerfile | |
workdir: containerized_analytics/smile/histogram | |
docker_repo_tag: socialmediamacroscope/histogram | |
github_repo_tag: ncsa/histogram | |
- name: check_screen_name | |
dockerfile: Dockerfile | |
workdir: containerized_analytics/smile/check_screen_name | |
docker_repo_tag: socialmediamacroscope/check_screen_name | |
github_repo_tag: ncsa/check_screen_name | |
- name: classification_predict | |
dockerfile: Dockerfile | |
workdir: containerized_analytics/smile/classification_predict | |
docker_repo_tag: socialmediamacroscope/classification_predict | |
github_repo_tag: ncsa/classification_predict | |
- name: classification_train | |
dockerfile: Dockerfile | |
workdir: containerized_analytics/smile/classification_train | |
docker_repo_tag: socialmediamacroscope/classification_train | |
github_repo_tag: ncsa/classification_train | |
- name: classification_split | |
dockerfile: Dockerfile | |
workdir: containerized_analytics/smile/classification_split | |
docker_repo_tag: socialmediamacroscope/classification_split | |
github_repo_tag: ncsa/classification_split | |
- name: collect_reddit_comment | |
dockerfile: Dockerfile | |
workdir: containerized_analytics/smile/collect_reddit_comment | |
docker_repo_tag: socialmediamacroscope/collect_reddit_comment | |
github_repo_tag: ncsa/collect_reddit_comment | |
- name: crimson_hexagon_monitors | |
dockerfile: Dockerfile | |
workdir: containerized_analytics/smile/crimson_hexagon_monitors | |
docker_repo_tag: socialmediamacroscope/crimson_hexagon_monitors | |
github_repo_tag: ncsa/crimson_hexagon_monitors | |
- name: image_crawler | |
dockerfile: Dockerfile | |
workdir: containerized_analytics/smile/image_crawler | |
docker_repo_tag: socialmediamacroscope/image_crawler | |
github_repo_tag: ncsa/image_crawler | |
- name: name_entity_recognition | |
dockerfile: Dockerfile | |
workdir: containerized_analytics/smile/name_entity_recognition | |
docker_repo_tag: socialmediamacroscope/name_entity_recognition | |
github_repo_tag: ncsa/name_entity_recognition | |
- name: network_analysis | |
dockerfile: Dockerfile | |
workdir: containerized_analytics/smile/network_analysis | |
docker_repo_tag: socialmediamacroscope/network_analysis | |
github_repo_tag: ncsa/network_analysis | |
- name: preprocessing | |
dockerfile: Dockerfile | |
workdir: containerized_analytics/smile/preprocessing | |
docker_repo_tag: socialmediamacroscope/preprocessing | |
github_repo_tag: ncsa/preprocessing | |
- name: screen_name_prompt | |
dockerfile: Dockerfile | |
workdir: containerized_analytics/smile/screen_name_prompt | |
docker_repo_tag: socialmediamacroscope/screen_name_prompt | |
github_repo_tag: ncsa/screen_name_prompt | |
- name: sentiment_analysis | |
dockerfile: Dockerfile | |
workdir: containerized_analytics/smile/sentiment_analysis | |
docker_repo_tag: socialmediamacroscope/sentiment_analysis | |
github_repo_tag: ncsa/sentiment_analysis | |
- name: topic_modeling | |
dockerfile: Dockerfile | |
workdir: containerized_analytics/smile/topic_modeling | |
docker_repo_tag: socialmediamacroscope/topic_modeling | |
github_repo_tag: ncsa/topic_modeling | |
- name: clowder_create_collection | |
dockerfile: Dockerfile | |
workdir: containerized_analytics/clowder/clowder_create_collection | |
docker_repo_tag: socialmediamacroscope/clowder_create_collection | |
github_repo_tag: ncsa/clowder_create_collection | |
- name: clowder_create_dataset | |
dockerfile: Dockerfile | |
workdir: containerized_analytics/clowder/clowder_create_dataset | |
docker_repo_tag: socialmediamacroscope/clowder_create_dataset | |
github_repo_tag: ncsa/clowder_create_dataset | |
- name: clowder_create_space | |
dockerfile: Dockerfile | |
workdir: containerized_analytics/clowder/clowder_create_space | |
docker_repo_tag: socialmediamacroscope/clowder_create_space | |
github_repo_tag: ncsa/clowder_create_space | |
- name: clowder_list | |
dockerfile: Dockerfile | |
workdir: containerized_analytics/clowder/clowder_list | |
docker_repo_tag: socialmediamacroscope/clowder_list | |
github_repo_tag: ncsa/clowder_list | |
- name: clowder_upload_file | |
dockerfile: Dockerfile | |
workdir: containerized_analytics/clowder/clowder_upload_file | |
docker_repo_tag: socialmediamacroscope/clowder_upload_file | |
github_repo_tag: ncsa/clowder_upload_file | |
steps: | |
# checkout source code | |
- uses: actions/checkout@v2 | |
# calculate version information | |
- name: version information | |
run: | | |
if [ "${{ github.event.release.target_commitish }}" != "" ]; then | |
BRANCH="${{ github.event.release.target_commitish }}" | |
elif [[ "${{github.event_name}}" == "pull_request" ]]; then | |
BRANCH="PR-${{github.event.pull_request.number}}" | |
else | |
BRANCH=${GITHUB_REF##*/} | |
fi | |
echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV | |
if [ "$BRANCH" == "main" ]; then | |
CHANGELOG_FILE="${{ matrix.workdir }}/CHANGELOG.md" | |
if [ -e "$CHANGELOG_FILE" ]; then | |
VERSION=$(cat "$CHANGELOG_FILE" | grep -Eo '\[[0-9]+\.[0-9]+\.[0-9]+\]'| head -1 | tr -d '[]') | |
VERSIONS="latest" | |
OLDVERSION="" | |
TMPVERSION=$VERSION | |
while [ "$OLDVERSION" != "$TMPVERSION" ]; do | |
VERSIONS="${VERSIONS} ${TMPVERSION}" | |
OLDVERSION="${TMPVERSION}" | |
TMPVERSION=$(echo ${OLDVERSION} | sed 's/\.[0-9]*$//') | |
done | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
echo "TAGS=${VERSIONS}" >> $GITHUB_ENV | |
else | |
echo "VERSION=latest" >> $GITHUB_ENV | |
echo "TAGS=latest" >> $GITHUB_ENV | |
fi | |
elif [ "$BRANCH" == "develop" ]; then | |
echo "VERSION=develop" >> $GITHUB_ENV | |
echo "TAGS=develop" >> $GITHUB_ENV | |
else | |
echo "VERSION=testing" >> $GITHUB_ENV | |
echo "TAGS=${BRANCH}" >> $GITHUB_ENV | |
fi | |
- name: Print Version tag | |
run: | | |
echo "${{ env.TAGS }}" | |
echo "${{ inputs.push_to_where }}" | |
echo "HUBPUSH=${{ inputs.push_to_where }}" >> $GITHUB_ENV | |
# login to registries | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build docker image | |
if: | | |
env.HUBPUSH == 'github' || env.HUBPUSH == 'dockerhub' | |
uses: elgohr/[email protected] | |
with: | |
dockerfile: ${{ matrix.dockerfile }} | |
name: ${{ matrix.docker_repo_tag }} | |
no_push: true | |
workdir: ${{ matrix.workdir }} | |
- name: Publish doc image to Docker Hub | |
if: | | |
env.HUBPUSH == 'dockerhub' | |
uses: elgohr/[email protected] | |
with: | |
registry: docker.io | |
name: ${{ matrix.docker_repo_tag }} | |
username: ${{ secrets.HUB_USERNAME }} | |
password: ${{ secrets.HUB_PASSWORD }} | |
tags: "${{ env.TAGS }}" | |
workdir: ${{ matrix.workdir }} | |
- name: Publish doc image to Github | |
if: | | |
env.HUBPUSH == 'github' | |
uses: elgohr/[email protected] | |
with: | |
registry: ghcr.io | |
name: ${{ matrix.github_repo_tag }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
tags: "${{ env.TAGS }}" | |
workdir: ${{ matrix.workdir }} |