Skip to content

Periodically Build and Publish to Registry #37

Periodically Build and Publish to Registry

Periodically Build and Publish to Registry #37

name: Periodically Build and Publish to Registry
env:
IMAGE_ROOT: singleuser
REGISTRY_HOSTNAME: docker.io
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
REPOSITORY: ${{ secrets.DOCKER_REPOSITORY }}
on:
schedule:
- cron: '0 0 * * 0' # At 00:00 every Sunday
workflow_dispatch:
jobs:
setup-build-publish-deploy:
name: Setup, Build, and Publish
runs-on: ubuntu-latest
continue-on-error: true
strategy:
max-parallel: 6
# select a core set of images to build
matrix:
IMAGE_VARIANT:
- base
- scientific-py3
- scientific-r
- summa-py3
- wrfhydro
- csdms-tools
steps:
- name: Checkout
uses: actions/checkout@v2
if: ${{ github.event.action }} != 'workflow_dispatch'
- name: Checkout, ref = ${{ github.ref_name }}
uses: actions/checkout@v2
if: ${{ github.event.action }} == 'workflow_dispatch'
with:
ref: ${{ github.ref_name }}
- name: Load .env file
uses: xom9ikk/dotenv@v2
with:
path: ${{ env.IMAGE_ROOT }}
# Build the Docker image
- name: Build
run: |
cd "${IMAGE_ROOT}"
docker compose build ${{ matrix.IMAGE_VARIANT }}
# TODO: run tests?