-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (54 loc) · 1.53 KB
/
pr-to-main.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: lpt-application-ui CI
on: # yamllint disable-line rule:truthy
pull_request:
types:
- opened
- edited
- reopened
- ready_for_review
- synchronize
branches:
# Only run on pull requests targeting main
- main
jobs:
build:
runs-on: ubuntu-latest
container: node:22
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- name: Cache dependencies
uses: actions/cache@v4.0.1
id: npm-cache
with:
path: |
${{ steps.npm-cache-dir.outputs.dir }}
/github/home/.cache/Cypress
key: npm-cypress-${{ hashFiles('package-lock.json') }}
restore-keys: |
npm-cypress-
npm-
- name: Install dependencies
run: npm ci --prefer-offline --no-audit --no-progress --no-fund
- name: Check linting across the board
shell: bash
run: npm run lint:ci
- name: Run unit tests
shell: bash
run: npm run test:cover
- name: Build application
shell: bash
run: npm run build
- name: GCP Auth
uses: 'google-github-actions/auth@v2'
with:
project_id: ${{ vars.GOOGLE_PROJECT_ID }}
credentials_json: ${{ secrets.AUTOMATION_SA_KEY_JSON }}
- name: Copy dist to bucket
shell: bash
run: |
gsutil cp dist/ gs://lpt-ui