Skip to content

Commit

Permalink
chore: fix deploy PR.. we must merge deploy PRs with 'rebase and merge'
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtPooki committed Nov 14, 2024
1 parent 0f87fcd commit f96431e
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,17 @@ jobs:
- name: Get latest tag
id: get_latest_tag
run: echo "tag=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_OUTPUT
# - name: Checkout latest tag
# run: git checkout ${{ steps.get_latest_tag.outputs.tag }}
# - name: Ensure staging-release branch points to latest tag
# run: |
# git checkout -B staging-release ${{ steps.get_latest_tag.outputs.tag }}
# git push origin staging-release --force
- name: Ensure staging-release branch points to latest tag
run: |
git reset --hard ${{ steps.get_latest_tag.outputs.tag }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
with:
token: ${{ secrets.SGTPOOKI_PAT }}
base: staging
branch: ${{ steps.get_latest_tag.outputs.tag }}
branch: staging-release
title: 'chore: point staging to release ${{ steps.get_latest_tag.outputs.tag }}'
body: 'This PR points the staging branch to release ${{ steps.get_latest_tag.outputs.tag }}.'
body: 'This PR points the staging branch to release ${{ steps.get_latest_tag.outputs.tag }}. **Choose "Rebase and merge" for this PR only!**'

# from https://github.com/peter-evans/create-pull-request/blob/main/docs/examples.md#keep-a-branch-up-to-date-with-another
deploy-production:
Expand All @@ -60,13 +57,12 @@ jobs:
- name: Set production branch to latest tag deployed to staging
run: |
git reset --hard ${{ steps.get_latest_tag.outputs.tag }}
git merge -X theirs ${{ steps.get_latest_tag.outputs.tag }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7.0.5
with:
token: ${{ secrets.SGTPOOKI_PAT }}
base: production
branch: production-release
title: 'chore: Point production to ${{ steps.get_latest_tag.outputs.tag }}'
body: 'This PR points the production branch to release ${{ steps.get_latest_tag.outputs.tag }}, which is the latest tag deployed to staging.'
body: 'This PR points the production branch to release ${{ steps.get_latest_tag.outputs.tag }}, which is the latest tag deployed to staging. **Choose "Rebase and merge" for this PR only!**'

0 comments on commit f96431e

Please sign in to comment.