Use repository permissions and branch pushes for CI [skip ci]
This commit is contained in:
parent
f6900faf02
commit
d53259a827
1 changed files with 4 additions and 17 deletions
|
|
@ -2,31 +2,24 @@ name: Check & deploy
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ['main']
|
|
||||||
pull_request:
|
|
||||||
branches: ['main']
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ${{ (github.actor == 'renovate-bot' || github.event.pull_request.user.login == 'renovate-bot' || startsWith(github.ref, 'refs/heads/renovate/') || startsWith(github.head_ref,
|
runs-on: docker
|
||||||
'renovate/')) && 'renovate' || 'docker' }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: https://github.com/actions/checkout@11d5960a326750d5838078e36cf38b85af677262
|
- uses: https://github.com/actions/checkout@11d5960a326750d5838078e36cf38b85af677262
|
||||||
|
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: https://github.com/actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
|
uses: https://github.com/actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: .nvmrc
|
||||||
cache: 'npm'
|
cache: npm
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
npm ci
|
npm ci
|
||||||
npx playwright install --with-deps chromium
|
npx playwright install --with-deps chromium
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: |
|
run: |
|
||||||
npm run lint:check
|
npm run lint:check
|
||||||
|
|
@ -34,15 +27,12 @@ jobs:
|
||||||
npm run typecheck
|
npm run typecheck
|
||||||
npm run typecheck:e2e
|
npm run typecheck:e2e
|
||||||
npm test
|
npm test
|
||||||
|
|
||||||
- name: Test E2E
|
- name: Test E2E
|
||||||
run: |
|
run: |
|
||||||
npm run test:e2e
|
npm run test:e2e
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
- name: Upload Playwright report
|
- name: Upload Playwright report
|
||||||
if: failure()
|
if: failure()
|
||||||
uses: https://github.com/actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
|
uses: https://github.com/actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
|
||||||
|
|
@ -52,14 +42,11 @@ jobs:
|
||||||
playwright-report/
|
playwright-report/
|
||||||
test-results/
|
test-results/
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|
||||||
- name: Upload static site artifact 1
|
- name: Upload static site artifact 1
|
||||||
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
|
if: ${{ github.ref == 'refs/heads/main' }}
|
||||||
uses: https://github.com/actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5
|
uses: https://github.com/actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5
|
||||||
with:
|
with:
|
||||||
name: pages-build-0
|
name: pages-build-0
|
||||||
path: dist
|
path: dist
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
if: ${{ contains(fromJSON('["andras","ruby336688","renovate-bot"]'), github.actor) && (!github.event.pull_request || contains(fromJSON('["andras","ruby336688","renovate-bot"]'),
|
|
||||||
github.event.pull_request.user.login)) }}
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue