Skip to content

Commit

Permalink
Check out Pull Request HEAD sha
Browse files Browse the repository at this point in the history
  • Loading branch information
jb3 authored Jul 14, 2024
1 parent 19d172c commit a3dbcc3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/deploy-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Check-out (Production)
uses: actions/checkout@v4
if: github.event_name == 'push'

- name: Check-out (Staging)
uses: actions/checkout@v4
if: github.event_name == 'pull_request_target'
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup Node.js
uses: actions/setup-node@v4
Expand Down Expand Up @@ -81,7 +89,7 @@ jobs:
name: Deploy to Staging
needs: [build]
runs-on: ubuntu-latest
if: github.head_ref != 'refs/heads/main'
if: github.event_name == 'pull_request_target'
environment:
name: staging
url: "https://${{ steps.slug.outputs.branch-name-slug }}.blog-staging.jb3.dev/"
Expand Down

0 comments on commit a3dbcc3

Please sign in to comment.