Skip to content

Commit

Permalink
chore: prod deploy pr fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtPooki committed Nov 13, 2024
1 parent eff95ae commit 99b3aa3
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,18 @@ jobs:
with:
token: ${{ secrets.SGTPOOKI_PAT }}
ref: production
- name: Fetch all tags
run: git fetch --tags
- name: Get latest tag merged into staging
- name: Get latest tag deployed to staging
id: get_latest_tag
run: |
git checkout origin/staging
latest_tag=$(git describe --tags $(git rev-list --tags --merged origin/staging --max-count=1))
latest_tag=$(git --no-pager log origin/staging --all --grep="chore: point staging to release v" --pretty=format:"%H %s" | head -n1 | sed -n 's/.*release \(v[0-9]*\.[0-9]*\.[0-9]*\).*/\1/p')
echo "tag=$latest_tag" >> $GITHUB_OUTPUT
- name: Ensure production branch points to latest staging
run: |
git fetch origin staging:staging
git reset --hard staging
- name: Checkout latest tag
run: git checkout ${{ 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.'
Expand Down

0 comments on commit 99b3aa3

Please sign in to comment.