diff --git a/.gitea/workflows/build-and-pubilsh.yaml b/.gitea/workflows/build-and-pubilsh.yaml index e7b29fd..4bdb192 100644 --- a/.gitea/workflows/build-and-pubilsh.yaml +++ b/.gitea/workflows/build-and-pubilsh.yaml @@ -2,10 +2,13 @@ name: Build and publish container images on: -# - workflow_dispatch - push: - branches: - - master + workflow_dispatch: + inputs: + tag: + type: string + description: Tag to Publish + default: latest + required: true jobs: build-and-publish: @@ -29,27 +32,41 @@ jobs: username: ${{ secrets.REGISTRY_USER }} password: ${{ secrets.REGISTRY_TOKEN }} - - name: Build Container and publish - uses: docker/build-push-action@v4 - env: - # see - ACTIONS_RUNTIME_TOKEN: '' - with: - context: . - push: true - tags: | - gitea.jbrumond.me/doc-utils/utils:latest - gitea.jbrumond.me/doc-utils/utils:0.2.0 - gitea.jbrumond.me/doc-utils/utils:0.2 - gitea.jbrumond.me/doc-utils/utils:0 - platforms: | - linux/amd64 - linux/arm64 - # linux/riscv64 - # linux/arm/v7 - # linux/arm/v6 - build-args: | - NODE_VERSION=20 - secrets: | - "npmrc=@doc-utils:registry=https://gitea.jbrumond.me/api/packages/doc-utils/npm/ - //gitea.jbrumond.me/api/packages/doc-utils/npm/:_authToken=${{ secrets.NPM_TOKEN }}" + - name: Parse Version String + shell: bash + run: | + if egrep '^[0-9]+\.[0-9]+\.[0-9]+$' <<<"$token" >/dev/null 2>&1 ; then + local n=${token//[!0-9]/ } + local a=(${n//\./ }) + echo "major=${a[0]}" >> $GITHUB_OUTPUT + echo "minor=${a[1]}" >> $GITHUB_OUTPUT + echo "patch=${a[2]}" >> $GITHUB_OUTPUT + else + echo 'Invalid semver version given' + exit 1 + fi + + # - name: Build Container and publish + # uses: docker/build-push-action@v4 + # env: + # # see + # ACTIONS_RUNTIME_TOKEN: '' + # with: + # context: . + # push: true + # tags: | + # gitea.jbrumond.me/doc-utils/utils:latest + # gitea.jbrumond.me/doc-utils/utils:0.2.0 + # gitea.jbrumond.me/doc-utils/utils:0.2 + # gitea.jbrumond.me/doc-utils/utils:0 + # platforms: | + # linux/amd64 + # linux/arm64 + # # linux/riscv64 + # # linux/arm/v7 + # # linux/arm/v6 + # build-args: | + # NODE_VERSION=22 + # secrets: | + # "npmrc=@doc-utils:registry=https://gitea.jbrumond.me/api/packages/doc-utils/npm/ + # //gitea.jbrumond.me/api/packages/doc-utils/npm/:_authToken=${{ secrets.NPM_TOKEN }}" diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index c559283..10b8eec 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -2,10 +2,10 @@ name: Build container images on: -- workflow_dispatch - # push: - # branches: - # - master + workflow_dispatch: { } + push: + branches: + - master jobs: build: