cron #1601
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: cron | |
on: | |
schedule: | |
- cron: '0 2 * * *' | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
env: | |
DOCKER_BUILDX_OUTPUT: --push | |
DOCKER_BUILDX_PLATFORM: linux/amd64,linux/arm64 | |
strategy: | |
fail-fast: false | |
matrix: | |
day_of_week: ['*', '0', '1', '2', '3', '4', '5', '6'] | |
include: | |
# next | |
- day_of_week: '*' | |
opencast_version: 'next' | |
push_major: 'false' | |
# stable | |
- day_of_week: '0' | |
opencast_version: 'master' | |
push_major: 'false' | |
- day_of_week: '1' | |
opencast_version: '17.0' | |
push_major: 'true' | |
- day_of_week: '2' | |
opencast_version: '17.0' | |
push_major: 'false' | |
- day_of_week: '3' | |
opencast_version: '17.0' | |
push_major: 'false' | |
# legacy | |
- day_of_week: '4' | |
opencast_version: '16.7' | |
push_major: 'true' | |
- day_of_week: '5' | |
opencast_version: '16.6' | |
push_major: 'false' | |
- day_of_week: '6' | |
opencast_version: '16.5' | |
push_major: 'false' | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ matrix.opencast_version }} | |
- name: set up Docker buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
platforms: ${{ env.DOCKER_BUILDX_PLATFORM }} | |
- uses: docker/login-action@v2 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_ROBOT_USERNAME }} | |
password: ${{ secrets.QUAY_ROBOT_PASSWORD }} | |
- name: build and push container images | |
run: | | |
if [ "${{ matrix.day_of_week }}" != "*" ]; then | |
if [ "${{ matrix.day_of_week }}" != $(date "+%w") ]; then | |
echo "Not scheduled today; exit" | |
exit | |
fi | |
fi | |
if [ "${{ matrix.opencast_version }}" = "master" ]; then | |
IMAGE_TAGS='latest' | |
else | |
IMAGE_TAGS="$(cat VERSION)" | |
if [ "${{ matrix.push_major }}" = 'true' ]; then | |
IMAGE_TAGS="${IMAGE_TAGS} $(cat VERSION_MAJOR)" | |
fi | |
fi | |
make \ | |
IMAGE_TAGS="${IMAGE_TAGS}" \ | |
DOCKER_BUILDX_PLATFORM="${DOCKER_BUILDX_PLATFORM}" \ | |
DOCKER_BUILDX_OUTPUT="${DOCKER_BUILDX_OUTPUT}" \ | |
build |