Created
June 7, 2022 17:20
-
-
Save jeffscottbrown/0cc4b9f03b85a8a0c84d7513078ee0cd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
name: Publish To GCR | |
on: | |
push: | |
tags: | |
- 'v*' | |
env: | |
GCLOUD_REGION: ${{ secrets.GCLOUD_REGION }} | |
PROJECT_ORGANIZATION: ${{ secrets.PROJECT_ORGANIZATION }} | |
DOCKER_IMAGE: ${{ secrets.DOCKER_REGISTRY_URL }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
~/.m2/repository | |
key: ${{ runner.os }}-gradle-test-${{ hashFiles('**/*.gradle') }} | |
restore-keys: ${{ runner.os }}-gradle-test- | |
- name: Setup GraalVM CE | |
uses: DeLaGuardo/[email protected] | |
with: | |
graalvm-version: 21.1.0.java11 | |
- name: Install Native Image | |
run: gu install native-image | |
- name: Setup Google Cloud CLI | |
uses: google-github-actions/setup-gcloud@master | |
with: | |
version: '290.0.1' | |
service_account_key: ${{ secrets.GCLOUD_SA_KEY }} | |
project_id: ${{ secrets.GCLOUD_PROJECT_ID }} | |
- name: Docker Login | |
run: | | |
gcloud auth configure-docker | |
- name: Build And Push Docker Image | |
env: | |
TESTCONTAINERS_RYUK_DISABLED: true | |
run: | | |
./gradlew check clean --no-daemon | |
./gradlew check assemble --no-daemon | |
./gradlew check dockerPushNative --no-daemon | |
- name: Deploy Cloud Run | |
run: | | |
gcloud run deploy music-search --quiet \ | |
--image "${DOCKER_IMAGE}" --project "${PROJECT_ORGANIZATION}" \ | |
--region "${GCLOUD_REGION}" --platform managed --allow-unauthenticated --format json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment