Skip to content

Commit

Permalink
Added automation to generate Docker images in the public repository. …
Browse files Browse the repository at this point in the history
…Tags will follow a `year.month` format, for example, `24.11`.
  • Loading branch information
JoaoGRRodrigues committed Nov 19, 2024
1 parent 1503354 commit 3cbae66
Show file tree
Hide file tree
Showing 9 changed files with 243 additions and 192 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/Yearly-model-mohidland.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Model - Mohid Land - Yearly

on:
# schedule:
# - cron: '0 0 1 1 *'
workflow_dispatch: # Permite execução manual do workflow


env:
TAG: 24.11
REPOSITORY: mohid-water-modelling-system
DOCKER_IMAGE_NAME: model/mohidland
jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write

steps:
- name: Read Image NAME
run: echo "The Docker image name is $IMAGE_NAME"

- name: Use Docker image name
run: echo "The Docker image name is $DOCKER_IMAGE_NAME"

- name: Delete huge unnecessary tools folder
run: rm -rf /opt/hostedtoolcache

- name: Checkout repository
uses: actions/checkout@v4

- name: Log into registry ghcr.io
if: github.event_name != 'pull_request'
uses: docker/login-action@v3 # v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build the Docker image
run: docker build . --file Solutions/dockers/MohidLand/dockerfile --tag ghcr.io/${{ env.REPOSITORY }}/${{ env.DOCKER_IMAGE_NAME }}:${{ env.TAG }}

- name: Push Docker image to GitHub Container Registry
run: docker push ghcr.io/${{ env.REPOSITORY }}/${{ env.DOCKER_IMAGE_NAME }}:${{ env.TAG }}
47 changes: 47 additions & 0 deletions .github/workflows/Yearly-model-mohidwater.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Model - Mohid Water - Yearly

on:
# schedule:
# - cron: '0 0 1 1 *'
workflow_dispatch: # Permite execução manual do workflow


env:
TAG: 24.11
REPOSITORY: mohid-water-modelling-system
DOCKER_IMAGE_NAME: model/mohidwater
jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write

steps:
- name: Read Image NAME
run: echo "The Docker image name is $IMAGE_NAME"

- name: Use Docker image name
run: echo "The Docker image name is $DOCKER_IMAGE_NAME"

- name: Delete huge unnecessary tools folder
run: rm -rf /opt/hostedtoolcache

- name: Checkout repository
uses: actions/checkout@v4

- name: Log into registry ghcr.io
if: github.event_name != 'pull_request'
uses: docker/login-action@v3 # v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build the Docker image
run: docker build . --file Solutions/dockers/MohidWater/dockerfile --tag ghcr.io/${{ env.REPOSITORY }}/${{ env.DOCKER_IMAGE_NAME }}:${{ env.TAG }}

- name: Push Docker image to GitHub Container Registry
run: docker push ghcr.io/${{ env.REPOSITORY }}/${{ env.DOCKER_IMAGE_NAME }}:${{ env.TAG }}
47 changes: 47 additions & 0 deletions .github/workflows/Yearly-tool-compare2hdf5files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Tool - Compare2HDFfiles - Yearly

on:
# schedule:
# - cron: '0 0 1 1 *'
workflow_dispatch: # Permite execução manual do workflow


env:
TAG: 24.11
REPOSITORY: mohid-water-modelling-system
DOCKER_IMAGE_NAME: tools/compare2hdf5files
jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write

steps:
- name: Read Image NAME
run: echo "The Docker image name is $IMAGE_NAME"

- name: Use Docker image name
run: echo "The Docker image name is $DOCKER_IMAGE_NAME"

- name: Delete huge unnecessary tools folder
run: rm -rf /opt/hostedtoolcache

- name: Checkout repository
uses: actions/checkout@v4

- name: Log into registry ghcr.io
if: github.event_name != 'pull_request'
uses: docker/login-action@v3 # v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build the Docker image
run: docker build . --file Solutions/dockers/Compare2HDFfiles/dockerfile --tag ghcr.io/${{ env.REPOSITORY }}/${{ env.DOCKER_IMAGE_NAME }}:${{ env.TAG }}

- name: Push Docker image to GitHub Container Registry
run: docker push ghcr.io/${{ env.REPOSITORY }}/${{ env.DOCKER_IMAGE_NAME }}:${{ env.TAG }}
47 changes: 47 additions & 0 deletions .github/workflows/Yearly-tool-convert2hdf5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Tool - Convert2HDF5 - Yearly

on:
# schedule:
# - cron: '0 0 1 1 *'
workflow_dispatch: # Permite execução manual do workflow


env:
TAG: 24.11
REPOSITORY: mohid-water-modelling-system
DOCKER_IMAGE_NAME: tools/convert2hdf5
jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write

steps:
- name: Read Image NAME
run: echo "The Docker image name is $IMAGE_NAME"

- name: Use Docker image name
run: echo "The Docker image name is $DOCKER_IMAGE_NAME"

- name: Delete huge unnecessary tools folder
run: rm -rf /opt/hostedtoolcache

- name: Checkout repository
uses: actions/checkout@v4

- name: Log into registry ghcr.io
if: github.event_name != 'pull_request'
uses: docker/login-action@v3 # v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build the Docker image
run: docker build . --file Solutions/dockers/Convert2HDF5/dockerfile --tag ghcr.io/${{ env.REPOSITORY }}/${{ env.DOCKER_IMAGE_NAME }}:${{ env.TAG }}

- name: Push Docker image to GitHub Container Registry
run: docker push ghcr.io/${{ env.REPOSITORY }}/${{ env.DOCKER_IMAGE_NAME }}:${{ env.TAG }}
47 changes: 47 additions & 0 deletions .github/workflows/Yearly-tool-convert2nc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Tool - Convert2Nc - Yearly

on:
# schedule:
# - cron: '0 0 1 1 *'
workflow_dispatch: # Permite execução manual do workflow


env:
TAG: 24.11
REPOSITORY: mohid-water-modelling-system
DOCKER_IMAGE_NAME: tools/convert2nc
jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write

steps:
- name: Read Image NAME
run: echo "The Docker image name is $IMAGE_NAME"

- name: Use Docker image name
run: echo "The Docker image name is $DOCKER_IMAGE_NAME"

- name: Delete huge unnecessary tools folder
run: rm -rf /opt/hostedtoolcache

- name: Checkout repository
uses: actions/checkout@v4

- name: Log into registry ghcr.io
if: github.event_name != 'pull_request'
uses: docker/login-action@v3 # v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build the Docker image
run: docker build . --file Solutions/dockers/Convert2NC/dockerfile --tag ghcr.io/${{ env.REPOSITORY }}/${{ env.DOCKER_IMAGE_NAME }}:${{ env.TAG }}

- name: Push Docker image to GitHub Container Registry
run: docker push ghcr.io/${{ env.REPOSITORY }}/${{ env.DOCKER_IMAGE_NAME }}:${{ env.TAG }}
40 changes: 0 additions & 40 deletions Solutions/dockers/MohidWater/FullCompileCode_CesgaFt3.sh

This file was deleted.

74 changes: 0 additions & 74 deletions Solutions/dockers/MohidWater/dockerfile_oss

This file was deleted.

Loading

0 comments on commit 3cbae66

Please sign in to comment.