Skip to content

support repeat of volumetric data (#192) #471

support repeat of volumetric data (#192)

support repeat of volumetric data (#192) #471

name: Build beautiful_atoms main image
env:
DOCKERHUB_USERNAME: luciusm
BASE_IMAGE_NAME: blender-env
IMAGE_NAME: beautiful-atoms
TEST_TAG: beautiful-atoms:tests
LATEST_VERSION: "3.4"
on:
push:
branches:
- main
- workflow
workflow_dispatch:
jobs:
build_main_image:
runs-on: ubuntu-latest
strategy:
matrix:
# Manually change these to match the blender image versions
blender-version: ["3.0", "3.1", "3.2", "3.4"]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get Tag
uses: olegtarasov/get-tag@v2.1
id: tagName
with:
tagRegex: "(v\\d+\\.\\d+\\.\\d+.*)"
# Add special release tag if tag exists
- name: Test tagger
run: |
echo ${{ steps.tagName.outputs }}
echo ${{ env.GIT_TAG_NAME }}
echo Current tag is ${{ env.GIT_TAG_NAME }}
- name: Pass Tagger Flag
run: |
echo "ADD_VERSION_DOCKER=${{ startsWith(env.GIT_TAG_NAME, 'v') }}" >> ${GITHUB_ENV}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: setup docker context for buildx
id: buildx-context
run: |
docker context create builders || :
- name: setup docker buildx
uses: docker/setup-buildx-action@v1
with:
endpoint: builders
- name: Login to Github Container Repo
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set lower case repository name
# Hint from https://github.community/t/github-actions-repository-name-must-be-lowercase/184924
run: |
echo "REPO_OWNER_LC=${OWNER,,}" >> ${GITHUB_ENV}
env:
OWNER: "${{ github.repository_owner }}"
- name: Name conversion between ghcr & dockerhub. Replace - with _
run: |
echo "DOCKERHUB_IMAGE_NAME=${IMG/-/_}" >> ${GITHUB_ENV}
env:
IMG: "${{ env.IMAGE_NAME }}"
- name: Push image to Dockerhub & GHCR
uses: docker/build-push-action@v3
with:
context: ./
file: ./Dockerfiles/Dockerfile.main
build-args: |
BLENDER_VER=${{ matrix.blender-version }}
BASE_IMAGE_NAME=ghcr.io/${{ env.REPO_OWNER_LC }}/${{ env.BASE_IMAGE_NAME }}
push: true
tags: |
ghcr.io/${{ env.REPO_OWNER_LC }}/${{ env.IMAGE_NAME }}:blender${{ matrix.blender-version }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Tag latest image
uses: akhilerm/tag-push-action@v2.0.0
with:
src: ghcr.io/${{ env.REPO_OWNER_LC }}/${{ env.IMAGE_NAME }}:blender${{ matrix.blender-version }}
dst: ghcr.io/${{ env.REPO_OWNER_LC }}/${{ env.IMAGE_NAME }}:latest
if: ${{ matrix.blender-version == env.LATEST_VERSION }}
# Tagging from ghcr --> dockerhub is optional and ok to fail
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Copy images between GHCR and Dockerhub
uses: akhilerm/tag-push-action@v2.0.0
with:
src: ghcr.io/${{ env.REPO_OWNER_LC }}/${{ env.IMAGE_NAME }}:blender${{ matrix.blender-version }}
dst: docker.io/${{ env.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_IMAGE_NAME }}:blender${{ matrix.blender-version }}
- name: Tag latest image dockerhub
uses: akhilerm/tag-push-action@v2.0.0
with:
src: docker.io/${{ env.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_IMAGE_NAME }}:blender${{ matrix.blender-version }}
dst: docker.io/${{ env.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_IMAGE_NAME }}:latest
if: ${{ matrix.blender-version == env.LATEST_VERSION }}
- name: Make version-tagged images only if there is a git tag in format 'vX.Y.Zetc'
uses: akhilerm/tag-push-action@v2.0.0
with:
src: ghcr.io/${{ env.REPO_OWNER_LC }}/${{ env.IMAGE_NAME }}:blender${{ matrix.blender-version }}
dst: |
docker.io/${{ env.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_IMAGE_NAME }}:blender${{ matrix.blender-version }}-${{ env.GIT_TAG_NAME }}
ghcr.io/${{ env.REPO_OWNER_LC }}/${{ env.IMAGE_NAME }}:blender${{ matrix.blender-version }}-${{ env.GIT_TAG_NAME }}
if: ${{ env.ADD_VERSION_DOCKER == 'true' }}