From ea7ea5659c4687185412e13625ceede2bb9cf1e3 Mon Sep 17 00:00:00 2001 From: eeeqeee <103794572+eeeqeee@users.noreply.github.com> Date: Thu, 7 Mar 2024 18:19:17 -0500 Subject: [PATCH 1/2] yep --- .github/workflows/new-release.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/new-release.yml b/.github/workflows/new-release.yml index d5809f10d3..ecade77b33 100644 --- a/.github/workflows/new-release.yml +++ b/.github/workflows/new-release.yml @@ -41,8 +41,12 @@ jobs: run: | if [[ -z "${{ steps.get-version.outputs.version }}" ]]; then echo "msg=deploy: $(git rev-parse HEAD)" >> $GITHUB_OUTPUT + echo "title=Deploy $(git rev-parse HEAD)" >> $GITHUB_OUTPUT + echo "title-master=Release $(git rev-parse HEAD)" >> $GITHUB_OUTPUT else echo "msg=deploy: version ${{ steps.get-version.outputs.version }} $(git rev-parse HEAD)" >> $GITHUB_OUTPUT + echo "title=Deploy version ${{ steps.get-version.outputs.version }} $(git rev-parse HEAD)" >> $GITHUB_OUTPUT + echo "title-master=Release version ${{ steps.get-version.outputs.version }} $(git rev-parse HEAD)" >> $GITHUB_OUTPUT fi - name: Yarn install run: | @@ -56,7 +60,7 @@ jobs: run: | NX_URL_GITHUB_GO_CURRENT_VERSION="https://github.com/${{ github.repository }}/commit/$(git rev-parse HEAD)" \ yarn run nx run frontend:build-vite:production - - name: Deploy to Github Pages + - name: Try deploy to Github Pages run: | git fetch origin gh-pages --depth=1 git worktree add ../gh-pages gh-pages --no-checkout @@ -64,11 +68,17 @@ jobs: cd ../gh-pages git add --all . git commit -m "${{ steps.get-commit-msg.outputs.msg }}" - git push - - name: Push + if ! git push origin; then + git push origin gh-pages:actions/deploy-gh-pages --force + gh pr create --base gh-pages --head actions/deploy-gh-pages --title '${{ steps.get-commit-msg.outputs.title }}' --body '' + fi + - name: Try push to master run: | git status - git push + if ! git push origin; then + git push origin master:actions/new-release --force + gh pr create --base master --head actions/new-release --title '${{ steps.get-commit-msg.outputs.title-master }}' --body '' + fi - name: Make release if: steps.get-version.outputs.version != '' run: | From 090f0aca24cae42d992d31495173536e4f17c11a Mon Sep 17 00:00:00 2001 From: eeeqeee <103794572+eeeqeee@users.noreply.github.com> Date: Thu, 7 Mar 2024 18:39:41 -0500 Subject: [PATCH 2/2] fixes --- .github/workflows/new-release.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/new-release.yml b/.github/workflows/new-release.yml index ecade77b33..b685b80617 100644 --- a/.github/workflows/new-release.yml +++ b/.github/workflows/new-release.yml @@ -69,16 +69,20 @@ jobs: git add --all . git commit -m "${{ steps.get-commit-msg.outputs.msg }}" if ! git push origin; then - git push origin gh-pages:actions/deploy-gh-pages --force + git push origin HEAD:actions/deploy-gh-pages --force gh pr create --base gh-pages --head actions/deploy-gh-pages --title '${{ steps.get-commit-msg.outputs.title }}' --body '' fi - - name: Try push to master + env: + GH_TOKEN: ${{ github.token }} + - name: Try push run: | git status if ! git push origin; then - git push origin master:actions/new-release --force - gh pr create --base master --head actions/new-release --title '${{ steps.get-commit-msg.outputs.title-master }}' --body '' + git push origin HEAD:actions/new-release --force + gh pr create --base $(git rev-parse --abbrev-ref HEAD) --head actions/new-release --title '${{ steps.get-commit-msg.outputs.title-master }}' --body '' fi + env: + GH_TOKEN: ${{ github.token }} - name: Make release if: steps.get-version.outputs.version != '' run: |