From 50d732f4cf267d326a1d3e77010908eecf7198df Mon Sep 17 00:00:00 2001 From: Walidoux Date: Mon, 16 May 2022 13:15:29 +0100 Subject: [PATCH] ci: update github's workflow --- .github/dependabot.yml | 7 ------- .github/workflows/build.yml | 26 ++++++++++++++++++++++++++ .github/workflows/lint.yml | 32 ++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 28 ++++++++++++++++++++++++++++ 4 files changed, 86 insertions(+), 7 deletions(-) delete mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index af97a4d..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,7 +0,0 @@ -version: 2 - -updates: - - package-ecosystem: "npm" - directory: "/" - schedule: - interval: "weekly" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..e41fb00 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,26 @@ +name: Build tests + +on: + push: + branches: [develop] + pull_request: + branches: [main, develop] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3.0.0 + + - name: Use Node.js + uses: actions/setup-node@v3.1.1 + with: + node-version: 16.x + + - name: Install packages + run: npm ci + + - name: Build project + run: npm run build diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..0ed0695 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,32 @@ +name: 'Lint tests' + +on: + push: + branches: [develop] + pull_request: + branches: [main, develop] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3.0.0 + + - name: Use Node.js + uses: actions/setup-node@v3.1.1 + with: + node-version: 16.x + + - name: Install packages + run: npm ci + + - name: Next.js linting + run: npm run lint:next + + - name: Prettier linting + run: npm run lint:prettier + + - name: Stylelint linting + run: npm run lint:scss diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a812cf1 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +name: 'Release version' + +on: + push: + branches: [main] + +jobs: + release: + runs-on: ubuntu-latest + if: ${{ github.ref == 'refs/heads/master' }} + needs: [quality] + steps: + - name: Checkout code + uses: actions/checkout@v3.0.0 + + - name: Use Node.js + uses: actions/setup-node@v3.1.1 + with: + node-version: 16.x + + - name: Install packages + run: npm ci + + - name: Release project + run: npm run release + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}