From cf54cb0bc2e367a8c10d3d739908d5a04f15a36b Mon Sep 17 00:00:00 2001 From: Arthur Simas Date: Wed, 25 May 2022 11:37:14 -0300 Subject: [PATCH 1/3] CI: not considering semver during manual deploy --- .github/workflows/deploy-manually.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-manually.yml b/.github/workflows/deploy-manually.yml index c87cfa1..07ed744 100644 --- a/.github/workflows/deploy-manually.yml +++ b/.github/workflows/deploy-manually.yml @@ -38,11 +38,13 @@ jobs: #new_release_published: ${{ steps.semantic.outputs.last_release_version != steps.semantic.outputs.new_release_version }} new_release_published: ${{ steps.semantic.outputs.new_release_published }} new_release_version: ${{ steps.semantic.outputs.new_release_version }} + test: ${{ (steps.semantic.outputs.new_release_published == 'true' && steps.semantic.outputs.new_release_version) || (github.event_name == 'workflow_dispatch' && '0.0.0') }} steps: - name: Checkout uses: actions/checkout@v2 - - name: Semantic Release + - if: github.event_name == 'workflow_dispatch' + name: Semantic Release uses: cycjimmy/semantic-release-action@v2 id: semantic with: @@ -58,12 +60,17 @@ jobs: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} deploy: - if: needs.semantic_release.outputs.new_release_published == 'true' + if: needs.semantic_release.outputs.new_release_published == 'true' || github.event_name == 'workflow_dispatch' needs: [extract_environment, semantic_release] runs-on: [self-hosted, '${{ needs.extract_environment.outputs.environment }}'] steps: + - name: print + env: + IMAGE_TAG: ${{ needs.semantic_release.outputs.test }} + run: echo ${IMAGE_TAG} + - name: Checkout uses: actions/checkout@v2 From 8399a0e4c1ddf71736500a703d5b58645d03b677 Mon Sep 17 00:00:00 2001 From: Arthur Simas Date: Wed, 25 May 2022 11:40:38 -0300 Subject: [PATCH 2/3] CI: . --- .github/workflows/deploy-manually.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-manually.yml b/.github/workflows/deploy-manually.yml index 07ed744..49f7e77 100644 --- a/.github/workflows/deploy-manually.yml +++ b/.github/workflows/deploy-manually.yml @@ -60,7 +60,7 @@ jobs: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} deploy: - if: needs.semantic_release.outputs.new_release_published == 'true' || github.event_name == 'workflow_dispatch' + if: ${{ needs.semantic_release.outputs.new_release_published == 'true' || github.event_name == 'workflow_dispatch' }} needs: [extract_environment, semantic_release] runs-on: [self-hosted, '${{ needs.extract_environment.outputs.environment }}'] @@ -68,8 +68,9 @@ jobs: steps: - name: print env: + EVENT: ${{ github.event_name }} IMAGE_TAG: ${{ needs.semantic_release.outputs.test }} - run: echo ${IMAGE_TAG} + run: echo ${IMAGE_TAG} ${EVENT} - name: Checkout uses: actions/checkout@v2 From 5d1a54a72068304d44093600b845fc5530e31c7a Mon Sep 17 00:00:00 2001 From: Arthur Simas Date: Wed, 25 May 2022 11:44:38 -0300 Subject: [PATCH 3/3] CI: . --- .github/workflows/deploy-manually.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-manually.yml b/.github/workflows/deploy-manually.yml index 49f7e77..630d065 100644 --- a/.github/workflows/deploy-manually.yml +++ b/.github/workflows/deploy-manually.yml @@ -39,11 +39,12 @@ jobs: new_release_published: ${{ steps.semantic.outputs.new_release_published }} new_release_version: ${{ steps.semantic.outputs.new_release_version }} test: ${{ (steps.semantic.outputs.new_release_published == 'true' && steps.semantic.outputs.new_release_version) || (github.event_name == 'workflow_dispatch' && '0.0.0') }} + testt: ${{ (needs.semantic_release.outputs.new_release_published == 'true' && needs.semantic_release.outputs.new_release_version) || '1.0.0' }} steps: - name: Checkout uses: actions/checkout@v2 - - if: github.event_name == 'workflow_dispatch' + - if: github.event_name != 'workflow_dispatch' name: Semantic Release uses: cycjimmy/semantic-release-action@v2 id: semantic @@ -60,7 +61,7 @@ jobs: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} deploy: - if: ${{ needs.semantic_release.outputs.new_release_published == 'true' || github.event_name == 'workflow_dispatch' }} + if: ${{ (github.event_name != 'workflow_dispatch' && needs.semantic_release.outputs.new_release_published == 'true') || 'true' }} needs: [extract_environment, semantic_release] runs-on: [self-hosted, '${{ needs.extract_environment.outputs.environment }}'] @@ -70,7 +71,8 @@ jobs: env: EVENT: ${{ github.event_name }} IMAGE_TAG: ${{ needs.semantic_release.outputs.test }} - run: echo ${IMAGE_TAG} ${EVENT} + IMAGE_TAGG: ${{ needs.semantic_release.outputs.testT }} + run: echo ${IMAGE_TAG} ${IMAGE_TAGG} ${EVENT} - name: Checkout uses: actions/checkout@v2