-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add deploy analytics step to release workflow
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,6 +130,48 @@ jobs: | |
gcloud run deploy ${{ secrets.GCP_PROJECT_ID }}-latest --image $IMAGE_NAME --region us-central1 --platform managed --allow-unauthenticated | ||
version="$(echo "${release_version//./}" | tr '[A-Z]' '[a-z]')" | ||
gcloud run deploy ${{ secrets.GCP_PROJECT_ID }}-$version --image $IMAGE_NAME --region us-central1 --platform managed --allow-unauthenticated | ||
deployanalytics: | ||
name: Deploy Analytics To Google Cloud Run | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
env: | ||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | ||
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }} | ||
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Set the current release version | ||
id: release_version | ||
run: | | ||
release_version=${GITHUB_REF:11} | ||
sed -i "s/^projectVersion.*$/projectVersion\=${release_version}/" gradle.properties | ||
echo "release_version=${release_version}" >> $GITHUB_OUTPUT | ||
- name: Login | ||
uses: google-github-actions/setup-gcloud@v0 | ||
with: | ||
project_id: ${{ secrets.GCP_PROJECT_ID }} | ||
service_account_email: ${{ secrets.GCP_EMAIL }} | ||
service_account_key: ${{ secrets.GCP_CREDENTIALS }} | ||
- name: Configure Docker | ||
run: gcloud auth configure-docker --quiet | ||
- name: Set up JDK | ||
uses: actions/[email protected] | ||
with: | ||
distribution: 'adopt' | ||
java-version: '11' | ||
- name: Run Tests | ||
run: ./gradlew grails-forge-analytics-postgres:test | ||
- name: Build and Push Docker image and deploy to Cloud Run | ||
env: | ||
IMAGE_NAME: gcr.io/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCP_APP_NAME }}-analytics:${{ steps.release_version.outputs.release_version }} | ||
# To deploy native executables built with GraalVM replace dockerBuild with dockerBuildNative and dockerPush with dockerPushNative. First, try that it works locally. | ||
run: | | ||
./gradlew grails-forge-analytics-postgres:dockerBuild -PdockerImageName="$IMAGE_NAME" | ||
./gradlew grails-forge-analytics-postgres:dockerPush -PdockerImageName="$IMAGE_NAME" | ||
gcloud run deploy ${{ secrets.GCP_PROJECT_ID }}-analytics-latest --image $IMAGE_NAME --region us-central1 --platform managed --allow-unauthenticated | ||
version="$(echo "${release_version//./}" | tr '[A-Z]' '[a-z]')" | ||
gcloud run deploy ${{ secrets.GCP_PROJECT_ID }}-analytics-$version --image $IMAGE_NAME --region us-central1 --platform managed --allow-unauthenticated | ||
linux: | ||
name: Release Linux Native CLI | ||
runs-on: ubuntu-latest | ||
|