-
Notifications
You must be signed in to change notification settings - Fork 2
66 lines (51 loc) · 1.77 KB
/
gcp.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
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Build and Deploy to GCP
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build-deploy:
name: Build and Deploy
runs-on: ubuntu-latest
# Add "id-token" with the intended permissions.
permissions:
contents: "read"
id-token: "write"
steps:
- name: Checkout
uses: actions/checkout@v4
- id: "auth"
name: "Authenticate to Google Cloud"
uses: "google-github-actions/auth@v2"
with:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDED }}
service_account: ${{ secrets.GCP_SA_EMAIL }}
- name: Setup gcloud environment
uses: google-github-actions/setup-gcloud@v2
- name: Google cloud info
run: gcloud info
- name: Setup docker
run: gcloud auth configure-docker
- uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
cache: "maven"
- uses: actions/setup-node@v4
with:
node-version: 16
cache: "npm"
- name: Ktlint
run: ./mvnw -B ktlint:check
- run: npm ci
- name: Eslint / prettier
run: npm run lint
- name: Full build
run: ./mvnw -B package
- name: Build and Deploy
run: ./mvnw -B compile jib:build -Pfrontend -Dnpm.ci.skip -Djib.to.image=eu.gcr.io/flock-community/flock-eco-workday -Djib.to.tags=${{ github.sha }} --file pom.xml
- name: Build and Deploy Development version
run: ./mvnw -B compile jib:build -Pdevelop,frontend -Dnpm.ci.skip -Dnpm.skip -Djib.container.environment=SPRING_PROFILES_ACTIVE=develop -Djib.to.image=eu.gcr.io/flock-community/flock-eco-workday-develop -Djib.to.tags=${{ github.sha }} --file pom.xml