Update maven-publish.yml

This commit is contained in:
Yevhenii Pokhvalii 2021-03-11 15:42:11 +02:00 committed by GitHub
parent fe072ed374
commit 52f2bd6390
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -38,12 +38,31 @@ jobs:
# username: ${{ secrets.DOCKER_USERNAME }} # username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }} # password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Push Docker Image - name: Setup GCP Service Account
uses: raccoondev/push-docker-gcr uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with: with:
gcr_host: gcr.io version: 'latest'
image_name: git-ops-automation/pet-clinic-test service_account_email: ${{ secrets.GCP_SA_EMAIL }}
image_tag: latest service_account_key: ${{ secrets.GCP_SA_KEY }}
env: export_default_credentials: true
GCLOUD_SERVICE_KEY: ${{ secrets.GCLOUD_SERVICE_KEY }}
GOOGLE_PROJECT_ID: ${{ secrets.GOOGLE_PROJECT_ID }} - 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 }}