url as argument

This commit is contained in:
Benjamin Brummer
2025-10-29 13:38:29 +01:00
parent 79dde723bd
commit cf822e0de9
2 changed files with 8 additions and 2 deletions

View File

@@ -15,6 +15,7 @@ jobs:
version: ${{ steps.version.outputs.version }} version: ${{ steps.version.outputs.version }}
major: ${{ steps.version.outputs.major }} major: ${{ steps.version.outputs.major }}
minor: ${{ steps.version.outputs.minor }} minor: ${{ steps.version.outputs.minor }}
url: ${{ steps.version.outputs.url }}
steps: steps:
- id: version - id: version
run: | run: |
@@ -25,6 +26,7 @@ jobs:
fi fi
MAJOR="$(echo "${VERSION}" | cut -d. -f1)" MAJOR="$(echo "${VERSION}" | cut -d. -f1)"
MINOR="$(echo "${VERSION}" | cut -d. -f2)" MINOR="$(echo "${VERSION}" | cut -d. -f2)"
URL=https://github.com/invoiceninja/invoiceninja/releases/download/v${VERSION}/invoiceninja.tar.gz
# Debug output # Debug output
echo "Current version: ${VERSION}" echo "Current version: ${VERSION}"
@@ -33,6 +35,8 @@ jobs:
echo "version=${VERSION}" >> $GITHUB_OUTPUT echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "major=${MAJOR}" >> $GITHUB_OUTPUT echo "major=${MAJOR}" >> $GITHUB_OUTPUT
echo "minor=${MINOR}" >> $GITHUB_OUTPUT echo "minor=${MINOR}" >> $GITHUB_OUTPUT
echo "minor=${MINOR}" >> $GITHUB_OUTPUT
echo "url=${URL}" >> $GITHUB_OUTPUT
build: build:
runs-on: ${{ startsWith(matrix.platform, 'linux/arm') && 'ubuntu-24.04-arm' || 'ubuntu-latest' }} runs-on: ${{ startsWith(matrix.platform, 'linux/arm') && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
@@ -75,7 +79,7 @@ jobs:
uses: docker/build-push-action@v6 uses: docker/build-push-action@v6
with: with:
context: debian context: debian
build-args: INVOICENINJA_VERSION=${{ needs.version.outputs.version }} build-args: URL=${{ needs.version.outputs.url }}
platforms: ${{ matrix.platform }} platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
tags: ${{ env.REGISTRY_IMAGE }} tags: ${{ env.REGISTRY_IMAGE }}

4
debian/Dockerfile vendored
View File

@@ -2,7 +2,9 @@ ARG PHP=8.4
FROM php:${PHP}-fpm AS prepare-app FROM php:${PHP}-fpm AS prepare-app
ADD --chown=www-data:www-data https://github.com/invoiceninja/invoiceninja/releases/latest/download/invoiceninja.tar.gz /tmp/invoiceninja.tar.gz ARG URL=https://github.com/invoiceninja/invoiceninja/releases/latest/download/invoiceninja.tar.gz
ADD --chown=www-data:www-data ${URL} /tmp/invoiceninja.tar.gz
USER www-data USER www-data