diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..70cd5db --- /dev/null +++ b/.github/workflows/deploy.yml @@ -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/write-properties@1.1.0 + 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' diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 4264406..2bfc901 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -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