diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 0071dc5..ab17f64 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -31,11 +31,22 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Get APP_VERSION + id: app_version + run: | + content=`cat ./${{ inputs.path }}/APP_VERSION` + echo "::set-output name=version::$content" - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@v5 with: images: ghcr.io/${{ github.repository }}/${{ inputs.name }} + tags: | + type=semver,pattern={{version}},value=${{ steps.app_version.version }} + type=semver,pattern={{major}}.{{minor}},value=${{ steps.app_version.version }} + type=semver,pattern={{major}},value=${{ steps.app_version.version }} + type=ref,event=branch + type=sha - name: Set up QEMU uses: docker/setup-qemu-action@v3 with: @@ -50,6 +61,8 @@ jobs: context: ${{ inputs.path }} file: ${{ inputs.path }}/${{ inputs.containerfile }} push: true + build-args: + - APP_VERSION=${{ steps.app_version.version }} annotations: ${{ steps.meta.outputs.annotations }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/nextcloud/APP_VERSION b/nextcloud/APP_VERSION new file mode 100644 index 0000000..8de81a2 --- /dev/null +++ b/nextcloud/APP_VERSION @@ -0,0 +1 @@ +24.0.4 diff --git a/nextcloud/Containerfile b/nextcloud/Containerfile index 256ac62..45906fc 100644 --- a/nextcloud/Containerfile +++ b/nextcloud/Containerfile @@ -1,7 +1,8 @@ FROM alpine:3.15 +ARG APP_VERSION + RUN set -ex; \ - \ apk add --no-cache \ bzip2 \ curl \ @@ -41,7 +42,6 @@ RUN set -ex; \ ln -sf /usr/bin/php8 /usr/bin/php RUN set -ex; \ - \ mkdir -p /var/www/html; \ groupmod -g 101 www-data; \ adduser -h /var/www/html -H -s /sbin/nologin -S -u 101 -G www-data www-data @@ -50,8 +50,8 @@ WORKDIR /var/www/html # set recommended PHP.ini settings # see https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/server_tuning.html#enable-php-opcache -ENV PHP_MEMORY_LIMIT 512M -ENV PHP_UPLOAD_LIMIT 1024M +ARG PHP_MEMORY_LIMIT=512M +ARG PHP_UPLOAD_LIMIT=1024M RUN { \ echo 'opcache.enable=1'; \ echo 'opcache.interned_strings_buffer=64'; \ @@ -80,7 +80,7 @@ RUN { \ chown -R www-data:www-data /var/www; \ chmod -R g=u /var/www -ENV NEXTCLOUD_VERSION 24.0.4 +ENV NEXTCLOUD_VERSION=${APP_VERSION} RUN set -ex; \ curl -fsSL -o nextcloud.tar.bz2 \