From e04796ca371d7cc0454b0c9d169f82f9f6b31437 Mon Sep 17 00:00:00 2001 From: Alfred Olsson <104556169+AlligatorAffe@users.noreply.github.com> Date: Thu, 18 Apr 2024 15:02:58 +0200 Subject: [PATCH 1/5] Create npm-publish-github-packages.yml --- .../workflows/npm-publish-github-packages.yml | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/npm-publish-github-packages.yml diff --git a/.github/workflows/npm-publish-github-packages.yml b/.github/workflows/npm-publish-github-packages.yml new file mode 100644 index 0000000..47a37f9 --- /dev/null +++ b/.github/workflows/npm-publish-github-packages.yml @@ -0,0 +1,36 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages + +name: Node.js Package + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - run: npm ci + - run: npm test + + publish-gpr: + needs: build + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + registry-url: https://npm.pkg.github.com/ + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} From 7a4753bb622b34dab1e712770834150d4521316c Mon Sep 17 00:00:00 2001 From: Alfred Olsson <104556169+AlligatorAffe@users.noreply.github.com> Date: Thu, 18 Apr 2024 15:03:41 +0200 Subject: [PATCH 2/5] Delete .github/workflows directory --- .github/workflows/node.js.yml | 31 ---------------- .../workflows/npm-publish-github-packages.yml | 36 ------------------- 2 files changed, 67 deletions(-) delete mode 100644 .github/workflows/node.js.yml delete mode 100644 .github/workflows/npm-publish-github-packages.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml deleted file mode 100644 index eb4d9d5..0000000 --- a/.github/workflows/node.js.yml +++ /dev/null @@ -1,31 +0,0 @@ -# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs - -name: Node.js CI - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - build: - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [14.x, 16.x, 18.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - - steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - run: npm ci - - run: npm run build --if-present - - run: npm test diff --git a/.github/workflows/npm-publish-github-packages.yml b/.github/workflows/npm-publish-github-packages.yml deleted file mode 100644 index 47a37f9..0000000 --- a/.github/workflows/npm-publish-github-packages.yml +++ /dev/null @@ -1,36 +0,0 @@ -# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created -# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages - -name: Node.js Package - -on: - release: - types: [created] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 16 - - run: npm ci - - run: npm test - - publish-gpr: - needs: build - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 16 - registry-url: https://npm.pkg.github.com/ - - run: npm ci - - run: npm publish - env: - NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} From 9d714eda3954ff747b23ac51ae3be2ce7f3417f8 Mon Sep 17 00:00:00 2001 From: Alfred Olsson <104556169+AlligatorAffe@users.noreply.github.com> Date: Thu, 18 Apr 2024 15:09:37 +0200 Subject: [PATCH 3/5] Create main.yml --- .github/workflows/main.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..5a4120c --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,24 @@ +name: Deploy to cPanel + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [14.x, 16.x, 18.x] + + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Install Dependencies + run: npm install + + - name: Build + run: npm run build From 65a749763abcd11167320cf905899497e14da926 Mon Sep 17 00:00:00 2001 From: Alfred Olsson <104556169+AlligatorAffe@users.noreply.github.com> Date: Thu, 18 Apr 2024 15:13:57 +0200 Subject: [PATCH 4/5] Update main.yml --- .github/workflows/main.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5a4120c..5407d8f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,11 +2,12 @@ name: Deploy to cPanel on: push: - branches: - - main + branches: [ "main" ] + pull_request: + branches: [ "main" ] jobs: - deploy: + build: runs-on: ubuntu-latest strategy: @@ -19,6 +20,3 @@ jobs: - name: Install Dependencies run: npm install - - - name: Build - run: npm run build From 311fb15afdc67fd8a05318bf352c52a885c17d94 Mon Sep 17 00:00:00 2001 From: Alfred Olsson <104556169+AlligatorAffe@users.noreply.github.com> Date: Thu, 18 Apr 2024 15:36:00 +0200 Subject: [PATCH 5/5] Create label.yml --- .github/workflows/label.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/label.yml diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml new file mode 100644 index 0000000..5f2ab50 --- /dev/null +++ b/.github/workflows/label.yml @@ -0,0 +1,25 @@ +name: "Pull Request Labeler" +on: +- pull_request_target + +jobs: + labeler: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - id: label-the-PR + uses: actions/labeler@v5 + + - id: run-frontend-tests + if: contains(steps.label-the-PR.outputs.all-labels, 'frontend') + run: | + echo "Running frontend tests..." + # Put your commands for running frontend tests here + + - id: run-backend-tests + if: contains(steps.label-the-PR.outputs.all-labels, 'backend') + run: | + echo "Running backend tests..." + # Put your commands for running backend tests here