From be8975bfbbccf2a4c0b87765781f2894bdae6421 Mon Sep 17 00:00:00 2001 From: Ramana Reddy <90540245+RamanaReddy0M@users.noreply.github.com> Date: Thu, 14 Mar 2024 12:12:53 +0530 Subject: [PATCH] Create test.yml --- .github/workflows/test.yml | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..53b2784 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,48 @@ +name: 🏗️ Compile latest changes + +on: + # pull_request: + # branches: + # - main + + workflow_dispatch: + + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 # Ensures history is available for commits + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: '20' + + - name: Install dependencies + run: npm install + + - name: Build project + run: npm run build + + - name: Configure Git + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + + - name: Commit changes + id: commit-changes + run: | + git add dist/ + git diff --quiet && git diff --staged --quiet || git commit -m "Update dist with compiled changes" + echo "::set-output name=CHANGES::$(git rev-parse HEAD)" + + - name: Push changes + if: steps.commit-changes.outputs.CHANGES + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.ref }}