Skip to content

Commit ed196a8

Browse files
Update google-cloudrun-docker.yml
1 parent cbb360e commit ed196a8

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

.github/workflows/google-cloudrun-docker.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
name: Deploy Angular Blog to Cloud Run
32

43
on:
@@ -7,10 +6,29 @@ on:
76
- main # or any other branch you use for production
87

98
jobs:
9+
test:
10+
name: Run Unit Tests
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: '18'
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
24+
- name: Run unit tests
25+
run: npm test
26+
1027
deploy:
1128
name: Build and Deploy
1229
runs-on: ubuntu-latest
13-
30+
needs: test
31+
1432
steps:
1533
- name: Checkout code
1634
uses: actions/checkout@v3
@@ -42,7 +60,6 @@ jobs:
4260
- name: Deploy to Cloud Run using Buildpacks
4361
uses: google-github-actions/deploy-cloudrun@v2
4462
with:
45-
service: angular-blog # your Cloud Run service name
46-
region: europe-central2 # match to your region
63+
service: angular-blog
64+
region: europe-central2
4765
source: .
48-

0 commit comments

Comments
 (0)