mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-23 07:45:49 +00:00
Update maven-publish.yml
This commit is contained in:
parent
fe072ed374
commit
52f2bd6390
1 changed files with 28 additions and 9 deletions
35
.github/workflows/maven-publish.yml
vendored
35
.github/workflows/maven-publish.yml
vendored
|
@ -38,12 +38,31 @@ jobs:
|
|||
# username: ${{ secrets.DOCKER_USERNAME }}
|
||||
# password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Build and Push Docker Image
|
||||
uses: raccoondev/push-docker-gcr
|
||||
- name: Setup GCP Service Account
|
||||
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
|
||||
with:
|
||||
gcr_host: gcr.io
|
||||
image_name: git-ops-automation/pet-clinic-test
|
||||
image_tag: latest
|
||||
env:
|
||||
GCLOUD_SERVICE_KEY: ${{ secrets.GCLOUD_SERVICE_KEY }}
|
||||
GOOGLE_PROJECT_ID: ${{ secrets.GOOGLE_PROJECT_ID }}
|
||||
version: 'latest'
|
||||
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
|
||||
service_account_key: ${{ secrets.GCP_SA_KEY }}
|
||||
export_default_credentials: true
|
||||
|
||||
- name: Configure Docker
|
||||
run: |
|
||||
gcloud auth configure-docker
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
docker build -t gcr.io/${{ secrets.GCP_PROJECT_ID }}/helloworld:latest .
|
||||
|
||||
- name: Push
|
||||
run: |
|
||||
docker push gcr.io/${{ secrets.GCP_PROJECT_ID }}/helloworld:latest
|
||||
|
||||
- name: Deploy
|
||||
run: |
|
||||
gcloud run deploy helloworld \
|
||||
--region europe-west1 \
|
||||
--image gcr.io/${{ secrets.GCP_PROJECT_ID }}/helloworld \
|
||||
--platform managed \
|
||||
--allow-unauthenticated \
|
||||
--project ${{ secrets.GCP_PROJECT_ID }}
|
||||
|
|
Loading…
Reference in a new issue