Skip to content

Commit

Permalink
chore: Update GKE credentials setup and location in gc.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
carlohcs committed Aug 12, 2024
1 parent 308659c commit 99e97e7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: Deploy to EKS
name: Build and Deploy to EKS (Amazon)
on:
push:
branches:
- main
jobs:
deploy:
name: Setup, Build, Publish, and Deploy
# Should deploy?
if: ${{ vars.DEPLOY_TO_EKS == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down
21 changes: 8 additions & 13 deletions .github/workflows/gc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

# TUTORIAL: https://docs.github.com/en/actions/use-cases-and-examples/deploying/deploying-to-google-kubernetes-engine

name: Build and Deploy to GKE
name: Build and Deploy to GKE (Google)

on:
push:
Expand All @@ -23,7 +23,7 @@ env:
# GAR_LOCATION: us-central1 # TODO: update region of the Artifact Registry
GAR_LOCATION: ${{ secrets.GKE_GAR_LOCATION }}
# GKE_CLUSTER: cluster-1 # TODO: update to cluster name
GKE_CLUSTER: my-cluster # TODO: update to cluster name
GKE_CLUSTER: ${{ secrets.GKE_CLUSTER }} # TODO: update to cluster name
# GKE_ZONE: us-central1-c # TODO: update to cluster zone
GKE_ZONE: ${{ secrets.GKE_ZONE }} # TODO: update to cluster zone
# DEPLOYMENT_NAME: gke-test # TODO: update to deployment name
Expand All @@ -36,6 +36,8 @@ env:
jobs:
setup-build-publish-deploy:
name: Setup, Build, Publish, and Deploy
# Should deploy?
if: ${{ vars.DEPLOY_TO_GKE == 'true' }}
runs-on: ubuntu-latest
environment: production

Expand All @@ -59,26 +61,19 @@ jobs:
# Alternative option - authentication via credentials json
- name: Google Cloud auth
id: 'auth'
uses: 'google-github-actions/auth@v2'
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'

- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1
with:
project_id: '${{ env.GKE_PROJECT }}'

- name: 'Docker auth'
- name: Docker auth
run: |-
gcloud auth configure-docker ${{ env.GAR_LOCATION }}-docker.pkg.dev
# - name: Docker configuration
# run: |-
# echo ${{steps.auth.outputs.access_token}} | docker login -u oauth2accesstoken --password-stdin https://$GAR_LOCATION-docker.pkg.dev

- name: 'Data'
run: echo GAR_LOCATION=$GAR_LOCATION && echo GKE_PROJECT=$GKE_PROJECT && echo GKE_CLUSTER=$GKE_CLUSTER && echo GKE_ZONE=$GKE_ZONE

# Get the GKE credentials so we can deploy to the cluster
- name: Set up GKE credentials
uses: google-github-actions/get-gke-credentials@v0
Expand Down
4 changes: 2 additions & 2 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import Layout from '../layouts/Layout.astro';
// import Card from '../components/Card.astro';
---

<Layout title="Welcome to Astro.">
<Layout title="Hello World!">
<main>
<h1>Hello <span class="text-gradient">World</span></h1>
<h1>Hello <span class="text-gradient">World!</span></h1>
</main>
</Layout>

Expand Down

0 comments on commit 99e97e7

Please sign in to comment.