Skip to content

Commit 3c5c017

Browse files
authored
Cric 2223 move circleci to GitHub actions (#1967)
1 parent 12756d9 commit 3c5c017

File tree

3 files changed

+33
-25
lines changed

3 files changed

+33
-25
lines changed

.circleci/config.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -189,19 +189,19 @@ workflows:
189189
version: 2
190190
build-deploy:
191191
jobs:
192-
- deploy-dev:
193-
filters:
194-
branches:
195-
only: feature
196-
- deploy-staging:
197-
filters:
198-
tags:
199-
only: /^staging.*/
200-
branches:
201-
ignore: /.*/
202-
- deploy-production:
203-
filters:
204-
tags:
205-
only: /^production.*/
206-
branches:
207-
ignore: /.*/
192+
# - deploy-dev:
193+
# filters:
194+
# branches:
195+
# only: feature
196+
# - deploy-staging:
197+
# filters:
198+
# tags:
199+
# only: /^staging.*/
200+
# branches:
201+
# ignore: /.*/
202+
# - deploy-production:
203+
# filters:
204+
# tags:
205+
# only: /^production.*/
206+
# branches:
207+
# ignore: /.*/

.github/workflows/deploy-dev.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ jobs:
1111
with:
1212
project_id: orsp-dev
1313
cluster: orsp-pub-dev
14-
cluster_region: us-central1
14+
cluster_region: us-central1-a
1515
artifact_registry: orsp-repo
16-
registry_region: us-central1
16+
registry_region: us-central1-a
1717
deployment: orsp-pub-dev
1818
image: orsp-dev-img
1919
project_number: 18883205905

.github/workflows/deploy.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,33 +51,39 @@ permissions:
5151
jobs:
5252
deploy:
5353
runs-on: ubuntu-latest
54+
5455
steps:
5556
- name: Checkout Repository
5657
uses: actions/checkout@v4
57-
58+
59+
# Authenticate to Google Cloud using Workload Identity
5860
- name: Authenticate to Google Cloud
5961
id: auth
6062
uses: google-github-actions/auth@v2
6163
with:
6264
workload_identity_provider: projects/${{ inputs.project_number }}/locations/global/workloadIdentityPools/orsp-dev-workloadpool/providers/github
6365
service_account: ${{ inputs.service_account }}
64-
65-
- name: Setup Gcloud
66+
token_format: access_token
67+
68+
- name: Setup gcloud
6669
uses: google-github-actions/setup-gcloud@v2
6770

71+
# Login to Artifact Registry
6872
- name: Docker Login
6973
uses: docker/login-action@v3
7074
with:
7175
registry: ${{ inputs.registry_region }}-docker.pkg.dev
7276
username: oauth2accesstoken
7377
password: ${{ steps.auth.outputs.access_token }}
7478

75-
- name: Extract Tag
79+
# Generate image tag using commit SHA
80+
- name: Generate Image Tag
7681
run: |
77-
TAG=${GITHUB_REF#refs/tags/}
78-
echo "IMAGE_URI=${{ inputs.registry_region }}-docker.pkg.dev/${{ inputs.project_id }}/${{ inputs.artifact_registry }}/${{ inputs.image }}:$TAG" >> $GITHUB_ENV
82+
TAG=${GITHUB_SHA::7}
83+
IMAGE_URI=${{ inputs.registry_region }}-docker.pkg.dev/${{ inputs.project_id }}/${{ inputs.artifact_registry }}/${{ inputs.image }}:$TAG
84+
echo "IMAGE_URI=$IMAGE_URI" >> $GITHUB_ENV
7985
80-
- name: Set up Docker Buildx
86+
- name: Setup Docker Buildx
8187
uses: docker/setup-buildx-action@v3
8288

8389
- name: Build and Push Docker Image
@@ -89,12 +95,14 @@ jobs:
8995
cache-from: type=gha
9096
cache-to: type=gha,mode=max
9197

98+
# Get credentials for GKE
9299
- name: Get GKE Credentials
93100
uses: google-github-actions/get-gke-credentials@v2
94101
with:
95102
cluster_name: ${{ inputs.cluster }}
96103
location: ${{ inputs.cluster_region }}
97104

105+
# Deploy to Kubernetes
98106
- name: Deploy to Kubernetes
99107
run: |
100108
set -e

0 commit comments

Comments
 (0)