From e3bc6e8c78f624182ffa23e775f931875ec0f42b Mon Sep 17 00:00:00 2001 From: Griko Nibras Date: Sat, 2 Dec 2023 00:45:46 +0700 Subject: [PATCH] feat: add deploy-dev workflow --- .github/workflows/deploy-dev.yml | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/deploy-dev.yml 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