From 29e1c39fa286face43056df5f365443a74524732 Mon Sep 17 00:00:00 2001 From: Admire Nyakudya Date: Mon, 21 Oct 2024 08:38:59 +0200 Subject: [PATCH] Update deployment file --- .github/workflows/deploy-image.yaml | 41 ++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-image.yaml b/.github/workflows/deploy-image.yaml index 98ff521..a2a545a 100644 --- a/.github/workflows/deploy-image.yaml +++ b/.github/workflows/deploy-image.yaml @@ -60,7 +60,7 @@ jobs: file: Dockerfile push: true tags: | - ${{ secrets.DOCKERHUB_REPO }}/pg-backup:${{ matrix.postgresMajorVersion }}-${{ matrix.postgisMajorVersion }}.${{ matrix.postgisMinorRelease }} + ${{ secrets.DOCKERHUB_REPO }}/pg-backup ${{ steps.check_hub_image_exists.outputs.check_image == 200 && format('{0}/pg-backup:{1}-{2}.{3}', secrets.DOCKERHUB_REPO, matrix.postgresMajorVersion, matrix.postgisMajorVersion, matrix.postgisMinorRelease) || null}} ${{ secrets.DOCKERHUB_REPO }}/pg-backup:${{ matrix.postgresMajorVersion }}-${{ matrix.postgisMajorVersion }}.${{ matrix.postgisMinorRelease }}--v${{ steps.current_date.outputs.formatted }} build-args: | @@ -72,3 +72,42 @@ jobs: type=gha,scope=prod cache-to: type=gha,scope=prod target: postgis-backup-production + + publish_release_artifacts: + runs-on: ubuntu-latest + timeout-minutes: 5 + if: | + github.actor != 'dependabot[bot]' && + !( + contains(github.event.pull_request.title, '[skip-release]') || + contains(github.event.comment.body, '/skiprelease') + ) && github.event.workflow_run.conclusion == 'success' + needs: [ deploy-image ] + strategy: + matrix: + geoserverMajorVersion: + - 2 + geoserverMinorVersion: + - minor: 26 + patch: 2 + steps: + - name: Checkout code + id: git_checkout + uses: actions/checkout@v3 + with: + ref: 'master' + + - name: Get Current Date + id: current_date + run: echo "formatted=$(date -u +%Y.%m.%d)" >> $GITHUB_OUTPUT + + - name: Get Latest Commit Hash + id: latest_commit_hash + run: echo "commit=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_OUTPUT + + - name: publish_release + id: tag_releases + run: | + gh release create v${{ matrix.postgresMajorVersion }}.${{ matrix.postgisMajorVersion }}.${{ matrix.postgisMinorRelease }}--v${{ steps.current_date.outputs.formatted }}--${{ steps.latest_commit_hash.outputs.commit }} --notes ${{ steps.latest_commit_hash.outputs.commit }} --target master --repo $GITHUB_REPOSITORY + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}