diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 8459e49..5581b2b 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -17,11 +17,26 @@ jobs: registry: gitea.gnilebein.de username: ${{ secrets.REG_GITEA_USERNAME }} password: ${{ secrets.REG_GITEA_PASSWORD }} - # - name: Build and push - # uses: docker/build-push-action@v6 - # with: - # platforms: linux/amd64,linux/arm64 - # push: true - # tags: | - # user/app:latest - # user/app:1.0.0 \ No newline at end of file + + - name: Get Meta + id: meta + run: | + echo VERSION=$(git ls-remote --tags -q https://github.com/rspamd/rspamd | sed -n "s/^[[:xdigit:]]\{40\}[[:blank:]]refs\/tags\/\([0-9]\{1\}\.[0-9]\{1,2\}\($\|\.[0-9]\{1,2\}$\)\)/\1/p" | sort --version-sort | tail -1) | tee -a $GITHUB_OUTPUT + echo COMMIT=$$(git ls-remote --tags -q https://github.com/rspamd/rspamd | sed -n "s/^\([[:xdigit:]]\{40\}\)[[:blank:]]refs\/tags\/${VERSION}^{}$/\1/p" | xargs git rev-parse --short) \ | tee -a $GITHUB_OUTPUT + echo BRANCH=$(git rev-parse --abbrev-ref HEAD) | tee -a $GITHUB_OUTPUT + echo DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") | tee -a $GITHUB_OUTPUT + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: StableV2 + push: true + no-cache: true + build-args: | + VERSION=${{ steps.meta.outputs.VERSION }} + COMMIT=${{ steps.meta.outputs.COMMIT }} + BRANCH=${{ steps.meta.outputs.BRANCH }} + DATE=${{ steps.meta.outputs.DATE }} + tags: | + ${{ vars.DOCKER_REPO }}/${{ vars.repository_owner }}/${{ vars.IMAGE_NAME }} + ${{ vars.DOCKER_REPO }}/${{ vars.repository_owner }}/${{ vars.IMAGE_NAME }}:${{ steps.meta.outputs.VERSION }} \ No newline at end of file