|
44 | 44 | DOMAIN_NAME: ${{ inputs.name }}.demo.community.intersystems.com
|
45 | 45 |
|
46 | 46 | # Leave this section untouched
|
47 |
| - PROJECT_ID: iris-community-demos |
48 |
| - CLUSTER_NAME: demo |
49 |
| - GITHUB_SHA: ${{ github.sha }} |
50 |
| - GCR_LOCATION: eu.gcr.io |
51 |
| - REGION: europe-west2 |
52 |
| - NAMESPACE: demo |
53 |
| - SERVICE_PORT: ${{ inputs.port }} |
| 47 | + PROJECT_ID: iris-community-demos |
| 48 | + CLUSTER_NAME: demo |
| 49 | + GITHUB_SHA: ${{ github.sha }} |
| 50 | + GITHUB_REPO: ${{ github.repository }} |
| 51 | + REGION: europe-west2 |
| 52 | + NAMESPACE: demo |
| 53 | + SERVICE_PORT: ${{ inputs.port }} |
54 | 54 | SERVICE_MEMORY: ${{ inputs.memory }}
|
55 | 55 |
|
56 | 56 | jobs:
|
57 | 57 | deploy-cloud-run:
|
58 | 58 | # if: github.event.repository.fork == false && github.event.repository.is_template == false
|
59 | 59 | name: Deploy to Cloud Run
|
60 |
| - runs-on: ubuntu-20.04 |
| 60 | + runs-on: ubuntu-22.04 |
61 | 61 | steps:
|
62 | 62 | - name: Checkout
|
63 |
| - uses: actions/checkout@v3 |
| 63 | + uses: actions/checkout@v4 |
64 | 64 | with:
|
65 | 65 | repository: ${{ inputs.repository }}
|
66 | 66 | ref: ${{ inputs.ref }}
|
67 | 67 |
|
68 | 68 | - name: Google Authentication
|
69 |
| - uses: google-github-actions/auth@v1.0.0 |
| 69 | + uses: google-github-actions/auth@v2.1.7 |
70 | 70 | with:
|
71 | 71 | credentials_json: ${{ secrets.SERVICE_ACCOUNT_KEY }}
|
72 | 72 |
|
73 | 73 | - name: Get GKE credentials
|
74 |
| - uses: google-github-actions/get-gke-credentials@v1.0.1 |
| 74 | + uses: google-github-actions/get-gke-credentials@v2.3.0 |
75 | 75 | with:
|
76 | 76 | project_id: ${{ env.PROJECT_ID }}
|
77 | 77 | cluster_name: ${{ env.CLUSTER_NAME }}
|
78 | 78 | location: ${{ env.REGION }}
|
79 | 79 |
|
80 | 80 | - name: Setup gcloud cli
|
81 |
| - uses: google-github-actions/setup-gcloud@v1.0.0 |
| 81 | + uses: google-github-actions/setup-gcloud@v2.1.2 |
82 | 82 | with:
|
83 |
| - version: '412.0.0' |
| 83 | + version: '504.0.0' |
84 | 84 |
|
85 | 85 | - name: Authorize Docker push
|
86 | 86 | run: |
|
87 |
| - gcloud auth list |
88 |
| - gcloud --quiet auth configure-docker |
| 87 | + gcloud --quiet auth configure-docker ${REGION}-docker.pkg.dev |
89 | 88 |
|
90 | 89 | - name: Build and Push image
|
91 | 90 | run: |
|
92 |
| - docker buildx build -t ${GCR_LOCATION}/${PROJECT_ID}/${IMAGE_NAME}:${GITHUB_SHA} --push . |
| 91 | + docker buildx build -t ${REGION}-docker.pkg.dev/${PROJECT_ID}/community/${IMAGE_NAME}:${GITHUB_SHA} --push . |
93 | 92 |
|
94 | 93 | - name: Deploy to Cloud Run
|
95 | 94 | run: |
|
96 | 95 | echo "[INFO] Set google project..."
|
97 | 96 | gcloud config set project ${PROJECT_ID}
|
98 | 97 |
|
99 | 98 | echo "[INFO] Deploy service..."
|
100 |
| - gcloud run deploy ${SERVICE} \ |
101 |
| - --platform gke \ |
102 |
| - --cluster ${CLUSTER_NAME} \ |
103 |
| - --cluster-location ${REGION} \ |
104 |
| - --namespace ${NAMESPACE} \ |
105 |
| - --port ${SERVICE_PORT:-52773} \ |
106 |
| - --min-instances 1 \ |
107 |
| - --memory ${SERVICE_MEMORY:-512Mi} \ |
108 |
| - --timeout 300 \ |
109 |
| - --verbosity debug \ |
110 |
| - --image ${GCR_LOCATION}/${PROJECT_ID}/${IMAGE_NAME}:${GITHUB_SHA} |
| 99 | + gcloud run deploy ${SERVICE} \ |
| 100 | + --platform gke \ |
| 101 | + --cluster ${CLUSTER_NAME} \ |
| 102 | + --cluster-location ${REGION} \ |
| 103 | + --namespace ${NAMESPACE} \ |
| 104 | + --port ${SERVICE_PORT:-52773} \ |
| 105 | + --min-instances 1 \ |
| 106 | + --memory ${SERVICE_MEMORY:-512Mi} \ |
| 107 | + --timeout 300 \ |
| 108 | + --verbosity debug \ |
| 109 | + --set-env-vars GITHUB_REPO=${GITHUB_REPO} \ |
| 110 | + --image ${REGION}-docker.pkg.dev/${PROJECT_ID}/community/${IMAGE_NAME}:${GITHUB_SHA} |
111 | 111 |
|
112 | 112 | echo "[INFO] Create domain mappings..."
|
113 | 113 | if [[ $(gcloud run domain-mappings list --platform gke --cluster ${CLUSTER_NAME} --cluster-location ${REGION} --namespace ${NAMESPACE} --filter "DOMAIN=${DOMAIN_NAME}" | grep -v DOMAIN | wc -l) == 0 ]]; then
|
|
0 commit comments