From 683ae8288dd65c61c655a20a7bfae307f81799c2 Mon Sep 17 00:00:00 2001 From: "Jeremy J. Miller" Date: Fri, 22 Sep 2023 09:29:00 -0400 Subject: [PATCH] moving bump commit and push tag to same step Signed-off-by: Jeremy J. Miller --- .github/workflows/main.yml | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0de374c..5051ed1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -47,13 +47,16 @@ jobs: skip-commit: 'true' skip-tag: 'true' skip-push: 'true' + token: ${{ secrets.GH_TOKEN }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} PACKAGEJSON_DIR: 'cmd' - - name: New Version Output - env: - NEW_TAG: ${{ steps.version-bump-app.outputs.newTag }} - run: echo "New version $NEW_TAG" + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git commit -am 'CI(version) ${{ steps.version-bump-app.outputs.newTag }}' + git tag ${{ steps.version-bump-app.outputs.newTag }} + git push origin main ${{ steps.version-bump-app.outputs.newTag }} - name: Retrieve Docker Image Name with Tag run: | echo "::set-output name=IMG_NAME_AND_TAG::$(make docker_img_name_and_tag)" @@ -67,18 +70,9 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push + - name: Build and publish Image uses: docker/build-push-action@v5 with: context: . push: true tags: ${{ steps.img_name_and_version_tag.outputs.IMG_NAME_AND_TAG }} - - name: Commit Files - with: - token: ${{ secrets.GH_TOKEN }} - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git commit -am 'CI(version) ${{ steps.version-bump-app.outputs.newTag }}' - git tag ${{ steps.version-bump-app.outputs.newTag }} - git push origin main ${{ steps.version-bump-app.outputs.newTag }}