Skip to content

Commit

Permalink
Merge pull request #894 from svalinn/cleanup_docker_deploy
Browse files Browse the repository at this point in the history
Cleanup docker deploy
  • Loading branch information
shimwell authored Aug 13, 2023
2 parents a828df3 + b9f52ca commit e9da6ab
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 20 deletions.
46 changes: 29 additions & 17 deletions .github/workflows/docker_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ on:
jobs:
build-dependency-img:
runs-on: ubuntu-latest
env:
hdf5_build_dir: hdf5_build_dir

strategy:
matrix:
Expand All @@ -32,7 +30,16 @@ jobs:
]

name: Installing Dependencies
steps:
steps:
- name: default environment
run: |
echo "tag-latest-on-default=false" >> "$GITHUB_ENV"
- name: condition on trigger parameters
if: ${{ github.repository_owner == 'svalinn' && github.ref == 'refs/heads/develop' }}
run: |
echo "tag-latest-on-default=true" >> "$GITHUB_ENV"
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
Expand All @@ -51,15 +58,13 @@ jobs:
server-stage: moab
quiet: false
parallel: true
tag-latest-on-default: false
tag-latest-on-default: ${{ env.tag-latest-on-default }}
dockerfile: CI/Dockerfile
build-args: COMPILER=${{ matrix.compiler }}, UBUNTU_VERSION=${{ matrix.ubuntu_versions }}, HDF5=${{ matrix.hdf5_versions }}, MOAB=${{ matrix.moab_versions }}

build-dagmc_test-img:
needs: [build-dependency-img]
runs-on: ubuntu-latest
env:
hdf5_build_dir: hdf5_build_dir

strategy:
matrix:
Expand All @@ -80,6 +85,15 @@ jobs:

name: Installing DAGMC
steps:
- name: default environment
run: |
echo "tag-latest-on-default=false" >> "$GITHUB_ENV"
- name: condition on trigger parameters
if: ${{ github.repository_owner == 'svalinn' && github.ref == 'refs/heads/develop' }}
run: |
echo "tag-latest-on-default=true" >> "$GITHUB_ENV"
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
Expand All @@ -90,23 +104,21 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Test DAGMC in Docker image
- name: Build & test DAGMC in Docker image
uses: firehed/multistage-docker-build-action@v1
with:
repository: ghcr.io/${{ github.repository_owner }}/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-${{ matrix.compiler }}-ext-hdf5_${{ matrix.hdf5_versions }}-moab_${{ matrix.moab_versions }}
stages: moab, dagmc
server-stage: dagmc_test
quiet: false
parallel: true
tag-latest-on-default: false
tag-latest-on-default: ${{ env.tag-latest-on-default }}
dockerfile: CI/Dockerfile
build-args: COMPILER=${{ matrix.compiler }}, UBUNTU_VERSION=${{ matrix.ubuntu_versions }}, HDF5=${{ matrix.hdf5_versions }}, MOAB=${{ matrix.moab_versions }}

push_stable_ci_img:
needs: [build-dagmc_test-img]
runs-on: ubuntu-latest
env:
hdf5_build_dir: hdf5_build_dir

strategy:
matrix:
Expand Down Expand Up @@ -135,16 +147,16 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push Image as stable img
if: ${{ github.repository_owner == 'svalinn' }}
- name: Push Image as latest img
if: ${{ github.repository_owner == 'svalinn' && github.ref == 'refs/heads/develop' }}
uses: akhilerm/[email protected]
with:
src: ghcr.io/${{ github.repository_owner }}/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-${{ matrix.compiler }}-ext-hdf5_${{ matrix.hdf5_versions }}-moab_${{ matrix.moab_versions }}/dagmc:refs_heads_${{ github.ref_name }}-bk0
dst: ghcr.io/${{ github.repository_owner }}/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-${{ matrix.compiler}}-ext-hdf5_${{ matrix.hdf5_versions }}-moab_${{ matrix.moab_versions }}:stable
src: ghcr.io/${{ github.repository_owner }}/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-${{ matrix.compiler }}-ext-hdf5_${{ matrix.hdf5_versions }}-moab_${{ matrix.moab_versions }}/dagmc:latest
dst: ghcr.io/${{ github.repository_owner }}/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-${{ matrix.compiler}}-ext-hdf5_${{ matrix.hdf5_versions}}-moab_${{ matrix.moab_versions }}:latest

- name: Push Image as latest img
if: ${{ github.repository_owner == 'svalinn' }}
if: ${{ github.repository_owner == 'svalinn' && github.ref == 'refs/heads/develop' }}
uses: akhilerm/[email protected]
with:
src: ghcr.io/${{ github.repository_owner }}/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-${{ matrix.compiler }}-ext-hdf5_${{ matrix.hdf5_versions }}-moab_${{ matrix.moab_versions }}/dagmc:refs_heads_${{ github.ref_name }}-bk0
dst: ghcr.io/${{ github.repository_owner }}/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-${{ matrix.compiler}}-ext-hdf5_${{ matrix.hdf5_versions}}-moab_${{ matrix.moab_versions }}:latest
src: ghcr.io/${{ github.repository_owner }}/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-${{ matrix.compiler }}-ext-hdf5_${{ matrix.hdf5_versions }}-moab_${{ matrix.moab_versions }}:latest
dst: ghcr.io/${{ github.repository_owner }}/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-${{ matrix.compiler}}-ext-hdf5_${{ matrix.hdf5_versions}}-moab_${{ matrix.moab_versions }}:stable
2 changes: 2 additions & 0 deletions .github/workflows/linux_build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
- '.github/workflows/windows_build_test.yml'
- '.github/workflows/housekeeping.yml'
- 'CI/**'
- 'doc/CHANGELOG.rst'
push:
branches:
- develop
Expand All @@ -21,6 +22,7 @@ on:
- '.github/workflows/windows_build_test.yml'
- '.github/workflows/housekeeping.yml'
- 'CI/**'
- 'doc/CHANGELOG.rst'

jobs:
BuildTest:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/mac_build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:
- '.github/workflows/windows_build_test.yml'
- '.github/workflows/housekeeping.yml'
- 'CI/**'
- 'doc/CHANGELOG.rst'

push:
branches:
- develop
Expand All @@ -21,6 +23,7 @@ on:
- '.github/workflows/windows_build_test.yml'
- '.github/workflows/housekeeping.yml'
- 'CI/**'
- 'doc/CHANGELOG.rst'

release:
types: # This configuration does not affect the page_build event above
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/windows_build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,22 @@ on:
- develop
paths-ignore:
- '.github/workflows/docker_publish.yml'
- '.github/workflows/mac_build_test.yml'
- '.github/workflows/linux_build_test.yml'
- '.github/workflows/mac_build_test.yml'
- '.github/workflows/housekeeping.yml'
- 'CI/**'
- 'doc/CHANGELOG.rst'

push:
branches:
- develop
paths-ignore:
- '.github/workflows/docker_publish.yml'
- '.github/workflows/mac_build_test.yml'
- '.github/workflows/linux_build_test.yml'
- '.github/workflows/mac_build_test.yml'
- '.github/workflows/housekeeping.yml'
- 'CI/**'
- 'doc/CHANGELOG.rst'

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion doc/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Next version
**Changed:**

* Improvements/corrections to graveyard capabilities (#855)
* Using multi stage Dockerfile to reduce the number of Dockerfile (#813)
* Using multi stage Dockerfile to reduce the number of Dockerfile (#813, #894)
* Adding safe folder to allow CI to compile DAGMC (#814)
* Correction to CMake variable name in OpenMC install instructions (#817)
* Updating documentation publishing URL (#823)
Expand Down

0 comments on commit e9da6ab

Please sign in to comment.