Skip to content

cron

cron #1079

Workflow file for this run

name: cron
on:
schedule:
- cron: '0 2 * * *'
jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
matrix:
day_of_week: ['*', '0', '1', '2', '3', '4', '5', '6']
include:
- day_of_week: '*'
opencast_version: 'next'
push_major: 'false'
- day_of_week: '0'
opencast_version: 'master'
push_major: 'false'
- day_of_week: '1'
opencast_version: '14.0'
push_major: 'true'
- day_of_week: '2'
opencast_version: '13.7'
push_major: 'false'
- day_of_week: '3'
opencast_version: '13.6'
push_major: 'false'
- day_of_week: '4'
opencast_version: '13.5'
push_major: 'false'
- day_of_week: '5'
opencast_version: '12.12'
push_major: 'false'
- day_of_week: '6'
opencast_version: '12.11'
push_major: 'false'
steps:
- uses: actions/checkout@v2
with:
ref: ${{ matrix.opencast_version }}
- uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_ROBOT_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_PASSWORD }}
- name: build-and-push
run: |
if [ "${{ matrix.day_of_week }}" != "*" ]; then
if [ "${{ matrix.day_of_week }}" != $(date "+%w") ]; then
echo "Not scheduled today; exit"
exit
fi
fi
make build
for distribution in \
admin \
adminpresentation \
allinone \
build \
ingest \
presentation \
worker; do
if [ "${{ matrix.opencast_version }}" == "master" ]; then
docker push "quay.io/opencast/${distribution}:latest"
else
docker push "quay.io/opencast/${distribution}:$(cat VERSION)"
if [ "${{ matrix.push_major }}" == 'true' ]; then
docker push "quay.io/opencast/${distribution}:$(cat VERSION_MAJOR)"
fi
fi
done