Skip to content

Commit

Permalink
split merge and push workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinMind committed Mar 15, 2024
1 parent 67bf133 commit d8799ba
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 13 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Merge

on:
merge_group:
# Required to make status check pass.
pull_request:
branches:
- main

jobs:
log:
runs-on: ubuntu-latest
steps:
- name: Log event
run: |
echo "json: ${{ github }}"
printenv
deploy_staging:
if: ${{ github.event_name == 'merge_group' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Deploy to staging
run: |
echo "Deploying to staging"
# Your deployment script here
13 changes: 0 additions & 13 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Push

on:
merge_group:
push:
branches:
- main
Expand All @@ -14,20 +13,8 @@ jobs:
run: |
echo "json: ${{ github }}"
printenv
deploy_staging:
if: ${{ github.event_name == 'merge_group' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Deploy to staging
run: |
echo "Deploying to staging"
# Your deployment script here
deploy_production:
if: ${{ github.event_name == 'push' }} && ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
needs: deploy_staging
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down

0 comments on commit d8799ba

Please sign in to comment.