From 664a93822acd0d88f9d4559d94d3136d7314302e Mon Sep 17 00:00:00 2001 From: Varakh Date: Sat, 9 Dec 2023 18:17:08 +0100 Subject: [PATCH] More generic way of publishing docker image with all proper semVer tags #noissue --- .editorconfig | 6 ++++++ .forgejo/workflows/build.yaml | 4 +++- .forgejo/workflows/release.yaml | 10 +++++++++- .forgejo/workflows/release_rebuild.yaml | 10 +++++++++- 4 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..a8addd6 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,6 @@ +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 +indent_style = space +indent_size = 4 diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index 64dd63f..015cb32 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -1,6 +1,7 @@ on: [push] env: REVISION: ${{ github.sha }} + IMAGE_TAG: varakh/hetzner-storagebox-exporter jobs: build: runs-on: docker @@ -28,4 +29,5 @@ jobs: uses: docker/build-push-action@v4 with: push: false - tags: varakh/hetzner-storagebox-exporter:${{ github.sha }} + tags: | + ${{ env.IMAGE_TAG }}:${{ github.sha }} diff --git a/.forgejo/workflows/release.yaml b/.forgejo/workflows/release.yaml index d708f75..c2c6e3f 100644 --- a/.forgejo/workflows/release.yaml +++ b/.forgejo/workflows/release.yaml @@ -4,6 +4,10 @@ on: - master env: REVISION: ${{ github.sha }} + IMAGE_TAG: varakh/hetzner-storagebox-exporter + VERSION_MAJOR: 1 + VERSION_MINOR: 0 + VERSION_PATCH: 0 jobs: build: runs-on: docker @@ -31,4 +35,8 @@ jobs: uses: docker/build-push-action@v4 with: push: true - tags: varakh/hetzner-storagebox-exporter:latest + tags: | + ${{ env.IMAGE_TAG }}:${{ env.VERSION_MAJOR }} + ${{ env.IMAGE_TAG }}:${{ env.VERSION_MAJOR }}.${{ env.VERSION_MINOR }} + ${{ env.IMAGE_TAG }}:${{ env.VERSION_MAJOR }}.${{ env.VERSION_MINOR }}.${{ env.VERSION_PATCH }} + ${{ env.IMAGE_TAG }}:latest diff --git a/.forgejo/workflows/release_rebuild.yaml b/.forgejo/workflows/release_rebuild.yaml index 14ca281..a062e89 100644 --- a/.forgejo/workflows/release_rebuild.yaml +++ b/.forgejo/workflows/release_rebuild.yaml @@ -3,6 +3,10 @@ on: - cron: "0 0 1 * *" env: REVISION: ${{ github.sha }} + IMAGE_TAG: varakh/hetzner-storagebox-exporter + VERSION_MAJOR: 1 + VERSION_MINOR: 0 + VERSION_PATCH: 0 jobs: build: runs-on: docker @@ -30,4 +34,8 @@ jobs: uses: docker/build-push-action@v4 with: push: true - tags: varakh/hetzner-storagebox-exporter:latest + tags: | + ${{ env.IMAGE_TAG }}:${{ env.VERSION_MAJOR }} + ${{ env.IMAGE_TAG }}:${{ env.VERSION_MAJOR }}.${{ env.VERSION_MINOR }} + ${{ env.IMAGE_TAG }}:${{ env.VERSION_MAJOR }}.${{ env.VERSION_MINOR }}.${{ env.VERSION_PATCH }} + ${{ env.IMAGE_TAG }}:latest