-
Notifications
You must be signed in to change notification settings - Fork 1
95 lines (93 loc) · 4.9 KB
/
push.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
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 }}