Skip to content

Docker Push

Docker Push #134

Workflow file for this run

name: Docker Push
on:
workflow_dispatch:
schedule:
- cron: "0 20 * * 1"
# github cron jobs are executed based on UTC https://jackharner.com/blog/github-actions-cron/
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get current date
id: date
run: echo "date=$(date +%F)" >> $GITHUB_OUTPUT
- uses: rickstaa/action-create-tag@v1
id: "tag_create"
with:
tag: ${{ steps.date.outputs.date }}
tag_exists_error: false
message: ""
- name: Login to DockerHub Registry
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Build pyiron/base
timeout-minutes: 5
run: |
docker build -t pyiron/base:latest base/
docker tag pyiron/base:latest pyiron/base:"$(date +%F)"
- name: Build pyiron/md
timeout-minutes: 5
run: |
tail --lines=+5 base/environment.yml >> md/environment.yml
docker build -t pyiron/md:latest md/
docker tag pyiron/md:latest pyiron/md:"$(date +%F)"
- name: Build pyiron/continuum
timeout-minutes: 5
run: |
docker build -t pyiron/continuum:latest continuum/
docker tag pyiron/continuum:latest pyiron/continuum:"$(date +%F)"
- name: Build pyiron/pyiron
timeout-minutes: 5
run: |
tail --lines=+5 md/environment.yml >> pyiron/environment.yml
docker build -t pyiron/pyiron:latest pyiron/
docker tag pyiron/pyiron:latest pyiron/pyiron:"$(date +%F)"
- name: Build pyiron/potentialworkshop
timeout-minutes: 5
run: |
tail --lines=+5 pyiron/environment.yml >> potentialworkshop/environment.yml
docker build -t pyiron/potentialworkshop:latest potentialworkshop/
docker tag pyiron/potentialworkshop:latest pyiron/potentialworkshop:"$(date +%F)"
- name: Build pyiron/experimental
timeout-minutes: 5
run: |
tail --lines=+5 base/environment.yml >> experimental/environment.yml
docker build -t pyiron/experimental:latest experimental/
docker tag pyiron/experimental:latest pyiron/experimental:"$(date +%F)"
- name: Build pyiron/mpie_cmti
timeout-minutes: 5
run: |
tail --lines=+5 pyiron/environment.yml >> mpie_cmti/environment.yml
docker build -t pyiron/mpie_cmti:latest mpie_cmti/
docker tag pyiron/mpie_cmti:latest pyiron/mpie_cmti:"$(date +%F)"
# Publish
- run: docker images
- run: docker push pyiron/base:latest
- run: docker push pyiron/base:"$(date +%F)"
- run: docker push pyiron/md:latest
- run: docker push pyiron/md:"$(date +%F)"
- run: docker push pyiron/pyiron:latest
- run: docker push pyiron/pyiron:"$(date +%F)"
- run: docker push pyiron/potentialworkshop:latest
- run: docker push pyiron/potentialworkshop:"$(date +%F)"
- run: docker push pyiron/experimental:latest
- run: docker push pyiron/experimental:"$(date +%F)"
- run: docker push pyiron/continuum:latest
- run: docker push pyiron/continuum:"$(date +%F)"
- run: docker push pyiron/mpie_cmti:latest
- run: docker push pyiron/mpie_cmti:"$(date +%F)"
# Export Environments
- run: mkdir -p environment; chmod 777 environment
- run: docker run -v $(pwd)/environment:/home/jovyan/ --rm pyiron/base /bin/bash -c 'source /opt/conda/bin/activate; conda env export > /home/jovyan/pyiron_base_$(date +%F).yml;'
- run: docker run -v $(pwd)/environment:/home/jovyan/ --rm pyiron/md /bin/bash -c 'source /opt/conda/bin/activate; conda env export > /home/jovyan/pyiron_md_$(date +%F).yml;'
- run: docker run -v $(pwd)/environment:/home/jovyan/ --rm pyiron/continuum /bin/bash -c 'source /opt/conda/bin/activate; conda env export > /home/jovyan/pyiron_continuum_$(date +%F).yml;'
- run: docker run -v $(pwd)/environment:/home/jovyan/ --rm pyiron/pyiron /bin/bash -c 'source /opt/conda/bin/activate; conda env export > /home/jovyan/pyiron_pyiron_$(date +%F).yml;'
- run: docker run -v $(pwd)/environment:/home/jovyan/ --rm pyiron/potentialworkshop /bin/bash -c 'source /opt/conda/bin/activate; conda env export > /home/jovyan/pyiron_potentialworkshop_$(date +%F).yml;'
- run: docker run -v $(pwd)/environment:/home/jovyan/ --rm pyiron/experimental /bin/bash -c 'source /opt/conda/bin/activate; conda env export > /home/jovyan/pyiron_experimental_$(date +%F).yml;'
- run: docker run -v $(pwd)/environment:/home/jovyan/ --rm pyiron/mpie_cmti /bin/bash -c 'source /opt/conda/bin/activate; conda env export > /home/jovyan/pyiron_mpie_cmti_$(date +%F).yml;'
- run: ls -al environment
- name: Release
uses: softprops/action-gh-release@v1
with:
files: environment/pyiron_*.yml
tag_name: ${{ steps.date.outputs.date }}