diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b8396ff5..9ec82002 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,8 @@ name: Build on: push: - branches: [ master ] + branches: + - master paths: - 'src/**' - 'autogen.sh' @@ -50,4 +51,4 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: build - run: cd contrib/docker && LIMITARCH=${{ github.event.inputs.limitarch }} GIT_REVISION=${{ steps.gittag.outputs.describe }} ./build.sh + run: cd contrib/docker && GIT_BRANCH=${GITHUB_REF##*/} LIMITARCH=${{ github.event.inputs.limitarch }} GIT_REVISION=${{ steps.gittag.outputs.describe }} ./build.sh diff --git a/contrib/docker/build.sh b/contrib/docker/build.sh index e52965db..fbed022f 100755 --- a/contrib/docker/build.sh +++ b/contrib/docker/build.sh @@ -27,6 +27,9 @@ if [[ -z "$1" ]]; then target=image outputFmt='-o type=docker,type=registry' tagsuffix=':devel' + if [[ -n "$GIT_BRANCH" ]] && [[ "x$GIT_BRANCH" != "xmaster" ]]; then + tagsuffix="$tagsuffix-$GIT_BRANCH" + fi elif [[ "x$1" = "xrelease" ]]; then namesuffix='.release' target=image diff --git a/contrib/docker/update.sh b/contrib/docker/update.sh index 65a4a0f6..626ae5ea 100755 --- a/contrib/docker/update.sh +++ b/contrib/docker/update.sh @@ -34,7 +34,7 @@ replaceTemplate if [[ -n "$1" ]]; then # build releases update make='GIT_REVISION=\$GIT_REVISION ./make_all.sh' - upload_lines='ARG UPLOAD_URL\nARG UPLOAD_CREDENTIALS\nARG UPLOAD_OS\nRUN if [ -n "\$UPLOAD_URL" ] \&\& [ -n "\$UPLOAD_CREDENTIALS" ]; then for img in ebusd-*.deb; do echo -n "upload \$img: "; curl -fsSk -u "\$UPLOAD_CREDENTIALS" -X POST --data-binary "@\$img" -H "Content-Type: application/octet-stream" "\$UPLOAD_URL/\$img?a=\$EBUSD_ARCH\&o=\$UPLOAD_OS\&v=\$EBUSD_VERSION" || echo "failed"; done; fi' + upload_lines='ARG UPLOAD_URL\nARG UPLOAD_CREDENTIALS\nARG UPLOAD_OS\nRUN if [ -n "\$UPLOAD_URL" ] \&\& [ -n "\$UPLOAD_CREDENTIALS" ]; then for img in ebusd-*.deb; do echo -n "upload \$img: "; curl -fsSk -u "\$UPLOAD_CREDENTIALS" -X POST --data-binary "@\$img" -H "Content-Type: application/octet-stream" "\$UPLOAD_URL/\$img?a=\$EBUSD_ARCH\&o=\$UPLOAD_OS\&v=\$EBUSD_VERSION&b=$GIT_BRANCH" || echo "failed"; done; fi' upload_lines+='\n\n\nFROM scratch as deb\nCOPY --from=build /build/*.deb /' namesuffix='.build' replaceTemplate