Skip to content

Merge pull request #12 from helxplatform/add-error-messages #14

Merge pull request #12 from helxplatform/add-error-messages

Merge pull request #12 from helxplatform/add-error-messages #14

# Workflow responsible for the
# development release processes.
#
name: Build-Push-Dev-Image
on:
push:
branches:
- develop
paths-ignore:
- README.md
- .github/*
- .github/workflows/*
- LICENSE
- .gitignore
- .dockerignore
- .githooks
# Do not build another image on a pull request.
# Any push to develop will trigger a new build however.
pull_request:
branches-ignore:
- '*'
jobs:
build-push-dev-image:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Set short git commit SHA
id: vars
run: |
echo "short_sha=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_OUTPUT
# https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
- name: Confirm git commit SHA output
run: echo ${{ steps.vars.outputs.short_sha }}
- name: Echo BINARY_NAME set in Makefile
id: BINARY_NAME
run: |
make echo >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
logout: true
- name: Login to Container Registry
uses: docker/login-action@v3
with:
registry: containers.renci.org
username: ${{ secrets.CONTAINERHUB_USERNAME }}
password: ${{ secrets.CONTAINERHUB_TOKEN }}
logout: true
# Notes on Cache:
# https://docs.docker.com/build/ci/github-actions/examples/#inline-cache
- name: Build Push Container
uses: docker/build-push-action@v5
with:
build-args: BINARY_NAME=${{ steps.BINARY_NAME.outputs.BINARY_NAME }}
context: .
push: true
# Push to renci-registry and dockerhub here.
# cache comes from dockerhub.
tags: |
${{ github.repository }}:develop
${{ github.repository }}:${{ steps.vars.outputs.short_sha }}
containers.renci.org/${{ github.repository }}:develop
containers.renci.org/${{ github.repository }}:${{ steps.vars.outputs.short_sha }}
cache-from: type=registry,ref=${{ github.repository }}:buildcache-dev
cache-to: type=registry,ref=${{ github.repository }}:buildcache-dev,mode=max