2019-11-26 01:05:58 +01:00
|
|
|
name: 'CI/CD Pipeline'
|
2019-11-13 18:43:58 +01:00
|
|
|
|
2019-12-07 15:16:07 +01:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-01-30 19:20:15 +01:00
|
|
|
- main
|
2019-12-07 15:16:07 +01:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- '**'
|
2019-11-13 18:43:58 +01:00
|
|
|
|
2023-09-09 17:13:10 +02:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
NEXT_PUBLIC_TYPEKIT_ID: ${{ secrets.NEXT_PUBLIC_TYPEKIT_ID }}
|
|
|
|
NEXT_PUBLIC_UMAMI_SCRIPT_URL: ${{ secrets.NEXT_PUBLIC_UMAMI_SCRIPT_URL }}
|
|
|
|
NEXT_PUBLIC_UMAMI_WEBSITE_ID: ${{ secrets.NEXT_PUBLIC_UMAMI_WEBSITE_ID }}
|
|
|
|
|
2019-11-13 18:43:58 +01:00
|
|
|
jobs:
|
2019-11-14 01:22:14 +01:00
|
|
|
test:
|
2019-11-13 18:43:58 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
2019-11-26 01:05:58 +01:00
|
|
|
steps:
|
2022-11-19 08:57:41 +01:00
|
|
|
- uses: actions/checkout@v3
|
2019-11-26 01:05:58 +01:00
|
|
|
|
2019-11-26 01:20:37 +01:00
|
|
|
- name: Setup Node.js
|
2022-11-19 08:57:41 +01:00
|
|
|
uses: actions/setup-node@v3
|
2019-11-26 01:05:58 +01:00
|
|
|
with:
|
2023-09-09 17:13:10 +02:00
|
|
|
node-version: 18
|
|
|
|
cache: 'npm'
|
2019-11-26 01:05:58 +01:00
|
|
|
|
|
|
|
- run: npm ci
|
2021-02-06 13:45:47 +01:00
|
|
|
- run: npm test
|
2019-11-26 02:18:54 +01:00
|
|
|
|
2021-09-01 20:10:47 +02:00
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: coverage
|
|
|
|
path: coverage/
|
|
|
|
|
|
|
|
coverage:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [test]
|
|
|
|
if: ${{ success() && github.actor != 'dependabot[bot]' }}
|
|
|
|
steps:
|
2022-11-19 08:57:41 +01:00
|
|
|
- uses: actions/checkout@v3
|
2021-09-01 20:10:47 +02:00
|
|
|
- uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: coverage
|
|
|
|
|
|
|
|
- uses: paambaati/codeclimate-action@v2.7.5
|
2019-11-26 02:18:54 +01:00
|
|
|
env:
|
|
|
|
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
|
2019-11-26 01:05:58 +01:00
|
|
|
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
2019-11-13 18:43:58 +01:00
|
|
|
steps:
|
2022-11-19 08:57:41 +01:00
|
|
|
- uses: actions/checkout@v3
|
2019-11-18 23:02:57 +01:00
|
|
|
|
2019-11-26 01:20:37 +01:00
|
|
|
- name: Setup Node.js
|
2022-11-19 08:57:41 +01:00
|
|
|
uses: actions/setup-node@v3
|
2019-11-13 18:53:31 +01:00
|
|
|
with:
|
2023-09-09 17:13:10 +02:00
|
|
|
node-version: 18
|
|
|
|
cache: 'npm'
|
2019-11-13 18:53:31 +01:00
|
|
|
|
2023-09-09 17:13:10 +02:00
|
|
|
- name: Cache Next.js build output
|
2022-11-16 00:14:59 +01:00
|
|
|
uses: actions/cache@v3
|
2019-11-13 18:53:31 +01:00
|
|
|
with:
|
2023-09-09 17:13:10 +02:00
|
|
|
path: ${{ github.workspace }}/.next/cache
|
2022-11-16 00:14:59 +01:00
|
|
|
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
|
|
|
|
restore-keys: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
|
2019-11-13 18:53:31 +01:00
|
|
|
|
2019-11-18 23:02:57 +01:00
|
|
|
- run: npm ci
|
|
|
|
- run: npm run build
|