-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (46 loc) · 1.49 KB
/
build-test.yml
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
name: CI
on:
push:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: ">= 18"
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules-${{ matrix.os }}-${{ matrix.node-version }}
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: Install dependencies
run: npm ci
- name: Lint files
run: npm run lint
provision:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3
- id: "auth"
name: "Authenticate to Google Cloud"
uses: "google-github-actions/auth@v1"
with:
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_CICD_SERVICE_ACCOUNT }}
# Install gcloud, `setup-gcloud` automatically picks up authentication from `auth`.
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v1"
# Now you can run gcloud commands authenticated as the impersonated service account.
- id: "gcloud"
name: "gcloud"
run: |-
gcloud storage buckets list --limit 10