Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create PRs in new-release.yml #1631

Merged
merged 7 commits into from
Mar 8, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions .github/workflows/new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -56,19 +60,29 @@ 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
cp -rT dist/apps/frontend ../gh-pages
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 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
env:
GH_TOKEN: ${{ github.token }}
- name: Try push
run: |
git status
git push
if ! git push origin; then
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need to move this to a workflow_run action that runs when the master-pr completes?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I forgot we had ff merges disabled

if: steps.get-version.outputs.version != ''
run: |
Expand Down