Skip to content

Commit

Permalink
chore(ci): helm deployment (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
guyvelleman authored Apr 21, 2022
1 parent 50f2d29 commit 6869d02
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gcr_push_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
required: true

jobs:
deploy:
build:
name: Build tag and push docker images to GCR.
runs-on: ubuntu-latest
steps:
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/helm_upgrade_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Push docker image to GCR reusable workflow

on:
workflow_call:
inputs:
app_name:
required: true
type: string
namespace_name:
required: true
type: string
values_file:
required: true
type: string
env_file:
required: true
type: string
secrets:
gcp_token:
required: true
AWS_ACCESS_KEY_ID:
required: true
AWS_SECRET_ACCESS_KEY:
required: true
jobs:
deploy:
name: Upgrade helm chart
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup GKE cluster
uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e
with:
cluster_name: web-devs
location: us-central1
credentials: ${{ secrets.gcp_token }}
- name: Helm tool installer
uses: Azure/setup-helm@v2.0
- name: Download starkware-third-party repo from S3.
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-2
run: |
helm plugin install https://starkware-third-party.s3.us-east-2.amazonaws.com/k8s/helm-s3/helm-s3-v0.9.2.tar.gz
helm repo add starkware s3://starkware-third-party/helm-repo/charts
helm repo update
- name: Upgrade using helm upgrade command.
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-2
run: |
helm upgrade ${{ inputs.app_name }} starkware/webapp-general-helm \
--namespace=${{ inputs.namespace_name }} \
--values ${{ inputs.values_file}} \
--set-file configMap.frontend.envs=${{ inputs.env_file }} \
--set frontend.image.tag=${{ github.ref_name }}
2 changes: 2 additions & 0 deletions .github/workflows/push_backend_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ jobs:
dockerfile: Dockerfile.backend
secrets:
gcp_token: ${{ secrets.STARKGATE_SA }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
29 changes: 29 additions & 0 deletions .github/workflows/push_frontend_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,32 @@ jobs:
dockerfile: Dockerfile.frontend
secrets:
gcp_token: ${{ secrets.STARKGATE_SA }}

deploy_devnet:
if: github.event.base_ref == 'refs/heads/dev'
needs: [push-frontend-image]
uses: ./.github/workflows/helm_upgrade_workflow.yml
with:
app_name: starkgate
namespace_name: starkgate-devnet
values_file: deployment/development.yml
env_file: .env.testing
secrets:
gcp_token: ${{ secrets.STARKGATE_SA }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}


deploy_testnet:
if: github.event.base_ref == 'refs/heads/master'
needs: [push-frontend-image]
uses: ./.github/workflows/helm_upgrade_workflow.yml
with:
app_name: starkgate
namespace_name: starkgate-goerli
values_file: deployment/testing.yml
env_file: .env.testing
secrets:
gcp_token: ${{ secrets.STARKGATE_SA }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
1 change: 0 additions & 1 deletion src/config/strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const strings = {
terms: {
titleTxt: 'Terms of Service',
lastRevisedTxt: 'Last Revised: April 4, 2022',
notesTitleTxt: 'Notes',
acceptBtnTxt: 'I Accept'
}
},
Expand Down

0 comments on commit 6869d02

Please sign in to comment.