-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (44 loc) · 1.55 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
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
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup GCP
uses: google-github-actions/setup-gcloud@v0
with:
project_id: flock-community
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true
- name: Setup docker
run: gcloud auth configure-docker
- uses: actions/setup-java@v1
with:
java-version: 17
- uses: actions/setup-node@v1
with:
node-version: '16'
- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Build and Deploy
run: ./mvnw -B compile -P frontend jib:build -Djib.to.image=gcr.io/flock-eco/flock-eco-workday -Djib.to.tags=${{ github.sha }} --file pom.xml
- name: Build and Deploy Development version
run: ./mvnw -B compile -P develop -P frontend jib:build -Djib.container.environment=SPRING_PROFILES_ACTIVE=develop -Djib.to.image=gcr.io/flock-eco/flock-eco-workday-develop -Djib.to.tags=${{ github.sha }} --file pom.xml