Skip to content

Commit

Permalink
Migrate to Artifact Registry
Browse files Browse the repository at this point in the history
  • Loading branch information
myardyas committed Feb 2, 2025
1 parent 85a3908 commit ec50599
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ on:
# ${{ secrets }} are taken from GitHub -> Settings -> Secrets
# ${{ github.sha }} is the commit hash
env:
PROJECT_ID: iris-community-demos
PROJECT_ID: iris-community-demos
SERVICE_ACCOUNT_KEY: ${{ secrets.SERVICE_ACCOUNT_KEY }}
GOOGLE_CREDENTIALS: ${{ secrets.TF_SERVICE_ACCOUNT_KEY }}
GITHUB_SHA: ${{ github.sha }}
GCR_LOCATION: eu.gcr.io
IMAGE_NAME: dc-analytics-image
GKE_CLUSTER: dc-analytics-cluster
GKE_ZONE: europe-west1-b
K8S_NAMESPACE: iris
STATEFULSET_NAME: dc-analytics
GOOGLE_CREDENTIALS: ${{ secrets.TF_SERVICE_ACCOUNT_KEY }}
GITHUB_SHA: ${{ github.sha }}
GCR_LOCATION: eu.gcr.io
IMAGE_NAME: dc-analytics-image
GKE_CLUSTER: dc-analytics-cluster
GKE_ZONE: europe-west1-b
REGION: europe-west2
K8S_NAMESPACE: iris
STATEFULSET_NAME: dc-analytics

jobs:
gcloud-setup-and-build-and-publish-to-GCR:
Expand All @@ -42,18 +43,17 @@ jobs:
version: '496.0.0'

- name: Configure docker to use the gcloud as a credential helper
run: |
gcloud --quiet auth configure-docker
run: gcloud --quiet auth configure-docker ${REGION}-docker.pkg.dev

- name: Build DC-ANALYTICS image
working-directory: iris
run: |
docker build -t ${GCR_LOCATION}/${PROJECT_ID}/${IMAGE_NAME}:${GITHUB_SHA} .
docker build -t ${REGION}-docker.pkg.dev/${PROJECT_ID}/community/${IMAGE_NAME}:${GITHUB_SHA} .
- name: Publish DC-ANALYTICS image to Google Container Registry
working-directory: iris
run: |
docker push ${GCR_LOCATION}/${PROJECT_ID}/${IMAGE_NAME}:${GITHUB_SHA}
docker push ${REGION}-docker.pkg.dev/${PROJECT_ID}/community/${IMAGE_NAME}:${GITHUB_SHA}
# gke-provisioner:
# # Inspired by:
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
working-directory: ./k8s/
run: |
cat statefulset.tpl |\
sed "s|DOCKER_REPO_NAME|${GCR_LOCATION}/${PROJECT_ID}/${IMAGE_NAME}|" |\
sed "s|DOCKER_REPO_NAME|${REGION}-docker.pkg.dev/${PROJECT_ID}/community/${IMAGE_NAME}|" |\
sed "s|DOCKER_IMAGE_TAG|${GITHUB_SHA}|" > statefulset.yaml
cat statefulset.yaml
Expand Down

0 comments on commit ec50599

Please sign in to comment.