From 636495a967f93f6f52c95e7e94d686dd4bcd44b3 Mon Sep 17 00:00:00 2001 From: EvolutionX Date: Sun, 31 Jul 2022 11:51:04 +0530 Subject: [PATCH] ci: update workflows --- .github/workflows/continuous-delivery.yml | 50 ++++++++++++++++++++ .github/workflows/continuous-integration.yml | 19 ++------ 2 files changed, 53 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/continuous-delivery.yml diff --git a/.github/workflows/continuous-delivery.yml b/.github/workflows/continuous-delivery.yml new file mode 100644 index 0000000..b78f3d9 --- /dev/null +++ b/.github/workflows/continuous-delivery.yml @@ -0,0 +1,50 @@ +name: Continuous Delivery + +on: + push: + branches: + - main + +jobs: + Automations: + name: Run Automations + runs-on: ubuntu-latest + + steps: + - name: Check out Git repository + uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 + + - name: Set up Node.js + uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3 + with: + node-version: 17 + + - name: Install Node.js dependencies + run: npm i -g prettier && npm i + + - name: Run Prettier + run: prettier --check . + + - name: Convert TypeScript to JavaScript + run: npx babel TypeScript --out-dir JavaScript --extensions ".ts" + + - name: Run JavaScript Prettier + run: prettier --write ./JavaScript + + - name: Create Pull Request + id: cpr + uses: peter-evans/create-pull-request@v4 + with: + commit-message: "chore: update JavaScript plugins" + branch: js + delete-branch: true + branch-suffix: short-commit-hash + title: "chore: Update JavaScript plugins" + body: "I have updated the JS Plugins for you!" + reviewers: EvolutionX-10 + - name: Enable Pull Request Automerge + if: steps.cpr.outputs.pull-request-operation == 'created' + uses: peter-evans/enable-pull-request-automerge@v2 + with: + pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} + merge-method: squash \ No newline at end of file diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 3001caa..21da6ad 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -11,8 +11,8 @@ on: - main jobs: - Automation: - name: Run Automations + Prettier: + name: Run Prettier runs-on: ubuntu-latest steps: @@ -29,17 +29,4 @@ jobs: run: npm i -g prettier && npm i - name: Run Prettier - run: prettier --check . - - - name: Convert TypeScript to JavaScript - run: npx babel TypeScript --out-dir JavaScript --extensions ".ts" - - - name: Run JavaScript Prettier - run: prettier --write ./JavaScript - - - name: Commit changes - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: "chore: update JavaScript plugins" - branch: js - create_branch: true \ No newline at end of file + run: prettier --check . \ No newline at end of file