Skip to content

Commit

Permalink
Update domain to use EU region (#396)
Browse files Browse the repository at this point in the history
* Update gcloud authentication mechanism to google-github-actions/auth@v2
* Simplify build
  • Loading branch information
ZzAve authored Jan 9, 2025
1 parent 41d634d commit 0c3081d
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 67 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore generated credentials from google-github-actions/auth
gha-creds-*.json

.idea
42 changes: 0 additions & 42 deletions .github/workflows/build.yml

This file was deleted.

60 changes: 35 additions & 25 deletions .github/workflows/gcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,49 +8,59 @@ on:
branches:
- master


jobs:
build-deploy:
name: Build and Deploy
runs-on: ubuntu-latest
steps:

# Add "id-token" with the intended permissions.
permissions:
contents: "read"
id-token: "write"

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup GCP
uses: google-github-actions/setup-gcloud@v0
- id: "auth"
name: "Authenticate to Google Cloud"
uses: "google-github-actions/auth@v2"
with:
project_id: flock-community
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true
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@v1
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: "temurin"
java-version: "17"
cache: "maven"

- uses: actions/setup-node@v1
- uses: actions/setup-node@v4
with:
node-version: '16'
node-version: 16
cache: "npm"

- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Ktlint
run: ./mvnw -B ktlint:check

- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- 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 -P frontend jib:build -Djib.to.image=gcr.io/flock-eco/flock-eco-workday -Djib.to.tags=${{ github.sha }} --file pom.xml
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 -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
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ coverage

/src/main/react/wirespec/

# Ignore generated credentials from google-github-actions/auth
gha-creds-*.json
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<kotlin.version>1.9.22</kotlin.version>
<gpg.skip>true</gpg.skip>
<wirespec.version>0.8.51</wirespec.version>
<npm.ci.skip>false</npm.ci.skip>
</properties>

<dependencies>
Expand Down Expand Up @@ -333,6 +334,7 @@
</goals>
<configuration>
<arguments>ci</arguments>
<skip>${npm.ci.skip}</skip>
</configuration>
</execution>
<execution>
Expand Down

0 comments on commit 0c3081d

Please sign in to comment.