-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (72 loc) · 2.49 KB
/
promote-to-latest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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" 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