From a688980526d2fbce712b3f6e8052db4277ff89b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EF=BC=AD=E2=99=A2=EF=BC=AE=EF=BC=B4=CE=9B=EF=BC=B3?= =?UTF-8?q?=EF=BC=A9=EF=BC=AD?= Date: Mon, 12 Aug 2024 15:10:42 +0600 Subject: [PATCH] feat: Add build-on-merge workflow --- .github/workflows/build-on-merge.yml | 43 ++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/build-on-merge.yml diff --git a/.github/workflows/build-on-merge.yml b/.github/workflows/build-on-merge.yml new file mode 100644 index 0000000..075c5d2 --- /dev/null +++ b/.github/workflows/build-on-merge.yml @@ -0,0 +1,43 @@ +name: Build on Merge + +on: + pull_request: + types: [closed] + branches: + - '**' + +jobs: + check-merge: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + + steps: + - name: Check out code + uses: actions/checkout@v3 + run: echo "Code checked out successfully." + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' + run: echo "Node.js set up with version $(node -v)." + + - name: Install dependencies + run: | + echo "Installing dependencies..." + yarn install + echo "Dependencies installed successfully." + + - name: Build the project + run: | + echo "Building the project..." + yarn build + if [ $? -eq 0 ]; then + echo "Build successful." + else + echo "Build failed." + exit 1 + fi + + - name: Check build success + run: echo "Build completed successfully, PR can be merged."