diff --git a/.github/workflows/deploy-dev.yml b/.github/workflows/deploy-dev.yml new file mode 100644 index 0000000..df4d519 --- /dev/null +++ b/.github/workflows/deploy-dev.yml @@ -0,0 +1,36 @@ +name: Deploy +on: + pull_request: + branches: [staging] + types: [closed] + push: + branches: [staging] + repository_dispatch: + types: [deploy-dev] + workflow_dispatch: + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - id: checkout + name: Checkout + uses: actions/checkout@v3 + with: + ref: dev + + - id: pull-staging + name: Pull latest 'staging' + run: git pull origin staging + + - id: diff-check + name: Check if 'dev' is behind 'staging' + run: git diff --exit-code origin/staging + + - id: fast-forward + name: Fast forward 'staging' → 'dev' + run: git merge --ff-only origin/staging + + - id: push-dev + name: Push latest 'dev' + run: git push --set-upstream origin dev