Promote to latest #124
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: Promote to latest | |
on: | |
workflow_dispatch: | |
jobs: | |
get_time: | |
runs-on: ubuntu-latest | |
outputs: | |
output1: ${{ steps.date.outputs.date }} | |
steps: | |
- name: Set current date as env variable | |
id: date | |
run: echo "date=$(date +"%Y%m%d_%H%M%S")" >> $GITHUB_OUTPUT | |
promote_to_latest: | |
needs: get_time | |
runs-on: ubuntu-latest | |
name: Promote from beta to latest | |
strategy: | |
fail-fast: false | |
matrix: | |
name: [ | |
'aio-apache', | |
'aio-borgbackup', | |
'aio-collabora', | |
'aio-domaincheck', | |
'all-in-one', | |
'aio-nextcloud', | |
'aio-notify-push', | |
'aio-postgresql', | |
'aio-redis', | |
'aio-talk', | |
'aio-watchtower', | |
'aio-clamav', | |
'aio-onlyoffice', | |
'aio-imaginary', | |
'aio-talk-recording', | |
'aio-fulltextsearch', | |
'aio-docker-socket-proxy'] | |
steps: | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Promote images from beta to latest | |
run: | | |
set -x | |
AIO_NAME=${{ matrix.name }} | |
DATE="${{needs.get_time.outputs.output1}}" | |
if [ -z "$DATE" ]; then | |
exit 1 | |
fi | |
set +x | |
# multiarch | |
docker buildx imagetools create --tag nextcloud/$AIO_NAME\:latest nextcloud/$AIO_NAME\:beta | |
docker buildx imagetools create --tag nextcloud/$AIO_NAME\:"$DATE"-latest nextcloud/$AIO_NAME\:beta | |
# arm64 | |
if [ "$AIO_NAME" != "aio-clamav" ]; then | |
docker buildx imagetools create --tag nextcloud/$AIO_NAME\:latest-arm64 nextcloud/$AIO_NAME\:beta-arm64 | |
fi | |
if [ "$AIO_NAME" == "aio-nextcloud" ]; then | |
set -x | |
docker pull nextcloud/$AIO_NAME\:beta | |
PHP_VERSION="$(docker inspect nextcloud/$AIO_NAME\:beta | grep PHP_VERSION | grep -oP '[0-8.]+' | sed 's|\.[0-9]\+$||')" | |
docker image remove --force nextcloud/$AIO_NAME\:beta | |
if [ -n "$PHP_VERSION" ]; then | |
# multiarch | |
docker buildx imagetools create --tag nextcloud/$AIO_NAME\:php"$PHP_VERSION"-latest nextcloud/$AIO_NAME\:beta | |
# arm64 | |
docker buildx imagetools create --tag nextcloud/$AIO_NAME\:php"$PHP_VERSION"-latest-arm64 nextcloud/$AIO_NAME\:beta-arm64 | |
fi | |
set +x | |
fi |