-
Notifications
You must be signed in to change notification settings - Fork 0
31 lines (31 loc) · 1.17 KB
/
deploy.yml
File metadata and controls
31 lines (31 loc) · 1.17 KB
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
name: cloudrun-deploy
on:
push:
branches:
- master
jobs:
setup-build-publish-deploy:
name: Setup, Build, Publish, and Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master # Setup gcloud CLI
- uses: google-github-actions/setup-gcloud@v0
with:
service_account_email: ${{ secrets.GCP_EMAIL }}
service_account_key: ${{ secrets.GCP_CREDENTIALS }}
export_default_credentials: true # Configure Docker with Credentials
- name: Configure Docker
run: |
gcloud auth configure-docker # Build the Docker image
- name: Build & Publish
run: |
gcloud config set project ${{ secrets.GCP_PROJECT }}
gcloud builds submit --tag gcr.io/${{ secrets.GCP_PROJECT }}/${{ secrets.GCP_APPLICATION }}
gcloud config set run/region us-central1 # Deploy the Docker image to the GKE cluster
- name: Deploy
run: |
gcloud run deploy ${{ secrets.GCP_APPLICATION }} --image gcr.io/${{ secrets.GCP_PROJECT }}/${{ secrets.GCP_APPLICATION }} \
--platform managed \
--allow-unauthenticated \
--memory 512M # Install RESTler