-
Notifications
You must be signed in to change notification settings - Fork 96
34 lines (34 loc) · 1.54 KB
/
gcf-snapshot.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
name: Snapshot to GCF
on:
push:
branches:
- 4.3.x
jobs:
deploy:
name: Deploy job
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/[email protected]
with:
distribution: 'adopt'
java-version: '17'
- name: Build the JAR
run: ./gradlew starter-api:test starter-gcp-function:test starter-gcp-function:shadowJar
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }}
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
PREDICTIVE_TEST_SELECTION: "${{ github.event_name == 'pull_request' && 'true' || 'false' }}"
- name: Authenticate into Google Cloud Platform
uses: google-github-actions/[email protected]
with:
service_account_email: ${{ secrets.GCLOUD_EMAIL }}
service_account_key: ${{ secrets.GCLOUD_AUTH }}
project_id: ${{ secrets.GCLOUD_FUNCTION_PROJECT }}
- name: Deploy to Cloud Function
run: |
cd starter-gcp-function/build/libs
gcloud functions deploy ${{ secrets.GCLOUD_SNAPSHOT_FUNCTION_NAME }} --trigger-http --project ${{ secrets.GCLOUD_FUNCTION_PROJECT }} --region us-central1 --allow-unauthenticated --service-account=${{ secrets.GCLOUD_EMAIL }} --quiet --entry-point io.micronaut.gcp.function.http.HttpFunction --runtime java17