forked from mdolab/dafoam
-
Notifications
You must be signed in to change notification settings - Fork 0
29 lines (26 loc) · 1.31 KB
/
docker.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
name: docker
on:
push:
branches:
- main
env:
DOCKER_ENV_FILE: '/home/dafoamuser/dafoam/loadDAFoam.sh'
DOCKER_OF_ADF_BASHRC: '/home/dafoamuser/dafoam/OpenFOAM/OpenFOAM-v1812-ADF/etc/bashrc'
DOCKER_OF_ADR_BASHRC: '/home/dafoamuser/dafoam/OpenFOAM/OpenFOAM-v1812-ADR/etc/bashrc'
jobs:
push_to_registry:
name: Deploy
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Build and push
run: |
echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u dafoam --password-stdin
docker pull dafoam/opt-packages:latest
docker run -i -d -u dafoamuser --name build_latest dafoam/opt-packages:latest /bin/bash
docker exec -i -e DAFOAM_NO_WARNINGS=1 build_latest /bin/bash -c ". ${{env.DOCKER_ENV_FILE}} && cd /home/dafoamuser/dafoam/repos && git clone https://github.com/mdolab/dafoam && cd dafoam && ./Allmake && . ${{env.DOCKER_OF_ADR_BASHRC}} && ./Allclean && ./Allmake && . ${{env.DOCKER_OF_ADF_BASHRC}} && ./Allclean && ./Allmake && pip install . && cd .. && rm -rf /home/dafoamuser/dafoam/repos/dafoam"
docker export build_latest > build_latest.tar
docker rm -f $(docker ps -a -q)
docker rmi -f dafoam/opt-packages:latest
docker import build_latest.tar dafoam/opt-packages:latest
docker push dafoam/opt-packages:latest