-
Notifications
You must be signed in to change notification settings - Fork 4
146 lines (121 loc) · 4.54 KB
/
docker_publish.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# This yml file will trigger a Github Action on release creation.
# This Action will build and upload a Docker image to GHCR
# https://github.com/marketplace/actions/publish-docker
name: docker-publish-release
on:
workflow_dispatch:
release:
types: [created]
jobs:
build_and_push_docker_images:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-single-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-single-buildx
- name: Build and push the Docker image
uses: docker/build-push-action@v2
with:
push: true
tags: ghcr.io/fusion-energy/fusion-neutronics-workflow:embree
build-args: |
include_avx=false
build_double_down=ON
cq_version=2.1
compile_cores=2
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Build and push the Docker image
uses: docker/build-push-action@v2
with:
push: true
tags: ghcr.io/fusion-energy/fusion-neutronics-workflow:embree-avx
build-args: |
include_avx=true
build_double_down=ON
cq_version=2.1
compile_cores=2
- name: Build and push the Docker image
uses: docker/build-push-action@v2
with:
push: true
tags: ghcr.io/fusion-energy/fusion-neutronics-workflow
build-args: |
include_avx=true
build_double_down=OFF
cq_version=2.1
compile_cores=2
upload_workflow_output_files_to_release:
needs: build_and_push_docker_images
runs-on: ubuntu-latest
name: 'create_files'
container:
image: ghcr.io/fusion-energy/fusion-neutronics-workflow
steps:
- uses: actions/checkout@v2
# the examples also appear on the docker image but they are in the
# /examples subfolder so there is no overlap with these examples
- name: run example_01_single_volume_cell_tally
run: |
cd example_01_single_volume_cell_tally
python 1_create_cad_and_convert_to_dagmc.py
python 2_run_neutronics_simulation.py
- name: run example_02_multi_volume_cell_tally
run: |
cd example_02_multi_volume_cell_tally
python 1_create_cad_and_convert_to_dagmc.py
python 2_run_neutronics_simulation.py
- name: run example_04_multi_volume_regular_mesh_tally
run: |
cd example_04_multi_volume_regular_mesh_tally
python 1_create_cad_and_convert_to_dagmc.py
python 2_run_neutronics_simulation.py
python 3_post_process_and_plot.py
# - name: run example_05_3D_unstructured_mesh_tally
# run: |
# cd example_05_3D_unstructured_mesh_tally
# python 1_create_cad_and_convert_to_dagmc.py
# mbconvert stage_2_output/unstructured_mesh.cub stage_2_output/unstructured_mesh.h5m
# python 2_run_neutronics_simulation.py
- name: compress files
run: |
apt-get -y update
apt-get -y install zip
zip -r output_files_produced.zip example_*
- name: Upload artifact for CI
uses: actions/upload-artifact@v2
with:
name: output_files_produced.zip
path: output_files_produced.zip
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
- name: Upload files into the release
uses: svenstaro/upload-release-action@v2
with:
overwrite: true
tag: ${{ github.ref }}
file: output_files_produced.zip
asset_name: output_files_produced.zip
repo_token: ${{ secrets.GITHUB_TOKEN }}