Skip to content

Commit f3f0afe

Browse files
authored
Merge pull request #2 from intersystems-community/use-artifact-registry
Migrate to Artifact Registry & Update actions versions
2 parents 2440e09 + f6e2b2c commit f3f0afe

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

.github/workflows/deployment.yml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -44,70 +44,70 @@ env:
4444
DOMAIN_NAME: ${{ inputs.name }}.demo.community.intersystems.com
4545

4646
# 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 }}
5454
SERVICE_MEMORY: ${{ inputs.memory }}
5555

5656
jobs:
5757
deploy-cloud-run:
5858
# if: github.event.repository.fork == false && github.event.repository.is_template == false
5959
name: Deploy to Cloud Run
60-
runs-on: ubuntu-20.04
60+
runs-on: ubuntu-22.04
6161
steps:
6262
- name: Checkout
63-
uses: actions/checkout@v3
63+
uses: actions/checkout@v4
6464
with:
6565
repository: ${{ inputs.repository }}
6666
ref: ${{ inputs.ref }}
6767

6868
- name: Google Authentication
69-
uses: google-github-actions/auth@v1.0.0
69+
uses: google-github-actions/auth@v2.1.7
7070
with:
7171
credentials_json: ${{ secrets.SERVICE_ACCOUNT_KEY }}
7272

7373
- 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
7575
with:
7676
project_id: ${{ env.PROJECT_ID }}
7777
cluster_name: ${{ env.CLUSTER_NAME }}
7878
location: ${{ env.REGION }}
7979

8080
- name: Setup gcloud cli
81-
uses: google-github-actions/setup-gcloud@v1.0.0
81+
uses: google-github-actions/setup-gcloud@v2.1.2
8282
with:
83-
version: '412.0.0'
83+
version: '504.0.0'
8484

8585
- name: Authorize Docker push
8686
run: |
87-
gcloud auth list
88-
gcloud --quiet auth configure-docker
87+
gcloud --quiet auth configure-docker ${REGION}-docker.pkg.dev
8988
9089
- name: Build and Push image
9190
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 .
9392
9493
- name: Deploy to Cloud Run
9594
run: |
9695
echo "[INFO] Set google project..."
9796
gcloud config set project ${PROJECT_ID}
9897
9998
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}
111111
112112
echo "[INFO] Create domain mappings..."
113113
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

Comments
 (0)