Skip to content

Commit

Permalink
chore: setup GitHub action
Browse files Browse the repository at this point in the history
  • Loading branch information
cybersokari committed Apr 17, 2024
1 parent 0519b75 commit 90461fd
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 2 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Java CI with Maven

on:
push:
branches: [ "main" ]
# pull_request:
# branches: [ "main" ]

jobs:
deploy:

runs-on: ubuntu-latest
permissions:
contents: read
id-token: write

steps:
- name: Write value to Properties-file
uses: christian-draeger/[email protected]
env:
MONGODB_URI: ${{ secrets.MONGODB_URI }}
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
GCLOUD_SERVICE_KEY: ${{secrets.GCLOUD_SERVICE_KEY}}
with:
path: './src/main/resources/application.properties'
property: |
'spring.data.mongodb.uri'
'google.client.id'
value: |
'$MONGODB_URI'
'$GOOGLE_CLIENT_ID'
- uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven

- name: Build with Maven
run: mvn -B package --file pom.xml

- name: Authenticate GCP
uses: google-github-actions/auth@v2
with:
service_account: $GCLOUD_SERVICE_KEY
deliverables: './src/main/appengine/app.yaml'
version: 'v2'
3 changes: 1 addition & 2 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
spring.application.name=gated_access_service
spring.data.mongodb.auto-index-creation=true
spring.data.mongodb.authentication-database=dev
spring.data.mongodb.database=dev
spring.data.mongodb.uri=mongodb://localhost:27017/dev
# swagger-ui custom path
springdoc.swagger-ui.path=/swagger-ui.html
springdoc.api-docs.enabled=true
# Google auth
#google.client.id=653203556655-osmibq6cnlnjs9i52mk9so0hiqnmv7oh.apps.googleusercontent.com
google.client.id=407408718192.apps.googleusercontent.com
Expand Down

0 comments on commit 90461fd

Please sign in to comment.