Merge pull request #1761 from nuclearkatie/resource_table_recording #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Latest Cyclus | |
on: | |
# allows us to run workflows manually | |
workflow_dispatch: | |
pull_request: | |
paths: | |
- '.github/workflows/publish_latest.yml' | |
push: | |
branches: | |
- main | |
jobs: | |
build-ubuntu-img: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
strategy: | |
matrix: | |
ubuntu_versions : [ | |
20.04, | |
22.04, | |
] | |
pkg_mgr : [ | |
apt, | |
conda, | |
] | |
name: Publish Ubuntu Latest | |
steps: | |
- name: Tag as ci-image-cache | |
run: | | |
echo "tag=ci-image-cache" >> "$GITHUB_ENV" | |
- name: Tag as latest | |
if: ${{ github.repository_owner == 'cyclus' && github.ref == 'refs/heads/main' }} | |
run: | | |
echo "tag=latest" >> "$GITHUB_ENV" | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Checkout Cyclus | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build, Test, and Push Cyclus | |
id: build-cyclus | |
uses: docker/build-push-action@v5 | |
with: | |
cache-from: type=registry,ref=ghcr.io/cyclus/cyclus_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cyclus:ci-layer-cache | |
cache-to: type=registry,ref=ghcr.io/cyclus/cyclus_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cyclus:ci-layer-cache,mode=max | |
file: docker/Dockerfile | |
push: true | |
tags: ghcr.io/cyclus/cyclus_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cyclus:${{ env.tag }} | |
build-args: | | |
pkg_mgr=${{ matrix.pkg_mgr }} | |
ubuntu_version=${{ matrix.ubuntu_versions }} | |
- name: Checkout Cycamore | |
uses: actions/checkout@v4 | |
with: | |
repository: cyclus/cycamore | |
path: ${{ github.workspace }}/cycamore | |
- name: Build, Test, and Push Cycamore | |
id: build-cycamore | |
continue-on-error: true | |
uses: docker/build-push-action@v5 | |
with: | |
context: ${{ github.workspace }}/cycamore | |
file: ${{ github.workspace }}/cycamore/docker/Dockerfile | |
cache-from: type=registry,ref=ghcr.io/cyclus/cycamore_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cycamore:ci-layer-cache | |
tags: ghcr.io/cyclus/cycamore_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cycamore:${{ env.tag }} | |
push: true | |
build-args: | | |
pkg_mgr=${{ matrix.pkg_mgr }} | |
ubuntu_version=${{ matrix.ubuntu_versions }} | |
cyclus_tag=${{ env.tag }}@${{ steps.build-cyclus.outputs.digest }} | |
- name: Checkout Cymetric | |
uses: actions/checkout@v4 | |
with: | |
repository: cyclus/cymetric | |
path: ${{ github.workspace }}/cymetric | |
- name: Build, Test, and Push Cymetric | |
continue-on-error: true | |
uses: docker/build-push-action@v5 | |
with: | |
context: ${{ github.workspace }}/cymetric | |
file: ${{ github.workspace }}/cymetric/docker/Dockerfile | |
cache-from: type=registry,ref=ghcr.io/cyclus/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:ci-layer-cache | |
tags: ghcr.io/cyclus/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:${{ env.tag }} | |
push: true | |
build-args: | | |
pkg_mgr=${{ matrix.pkg_mgr }} | |
ubuntu_version=${{ matrix.ubuntu_versions }} | |
cycamore_tag=${{ env.tag }}@${{ steps.build-cycamore.outputs.digest }} | |
build-rocky-img: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
strategy: | |
matrix: | |
rocky_versions : [ | |
8, | |
9, | |
] | |
name: Publish Rocky Latest | |
steps: | |
- name: Tag as ci-image-cache | |
run: | | |
echo "tag=ci-image-cache" >> "$GITHUB_ENV" | |
- name: Tag as latest | |
if: ${{ github.repository_owner == 'cyclus' && github.ref == 'refs/heads/main' }} | |
run: | | |
echo "tag=latest" >> "$GITHUB_ENV" | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Checkout Cyclus | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build, Test, and Push Cyclus | |
id: build-cyclus | |
uses: docker/build-push-action@v5 | |
with: | |
cache-from: type=registry,ref=ghcr.io/cyclus/cyclus_rocky_${{ matrix.rocky_versions }}/cyclus:ci-layer-cache | |
cache-to: type=registry,ref=ghcr.io/cyclus/cyclus_rocky_${{ matrix.rocky_versions }}/cyclus:ci-layer-cache,mode=max | |
file: docker/Rocky.dockerfile | |
push: true | |
tags: ghcr.io/cyclus/cyclus_rocky_${{ matrix.rocky_versions }}/cyclus:${{ env.tag }} | |
build-args: | | |
rocky_version=${{ matrix.rocky_versions }} |