-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploy latest version to production (#340)
* Deployment Workflow Update (#332) * ci(workflow): moved ingress deployment to seprate workflows * ci(deploy workflow): updated gcloud actions and removed ingress+cert from finalize steps * ci(e2e workflow): now runs on changes to relevant paths and added allure generate step * fix(e2e workflow): fixed trigger paths * fix(server): added prisma seed path to jest ignore * chore(dx): remove husky precommit; it's annoying * Modify client arch to be more consistent with server & improve error handling on server (#328) * feat(client): move src/features/core to src/core; more consistent with server arch * feat(server): implement new ProtectedError class, integrate into accounts * Client Fixes (#336) * fix(client): re-added imgs removed by mistake * fix(client): event form now displays correctly * Dockerfile Optimizations + Workflow Trigger (#338) * chore(dockerfiles): copy only nessisary files * chore(client dockerfile): commens and cleanup * fix(dockerfiles): typo * ci(workflow): added relevant dockerfile as path trigger * chore(graphql): removed deprecated queries and subscriptions * ci(prod workflows): removed old unused if checks Co-authored-by: DevelopmentByDavid <[email protected]> Co-authored-by: DevelopmentByDavid <[email protected]>
- Loading branch information
1 parent
6e06046
commit 34b5505
Showing
82 changed files
with
509 additions
and
554 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ on: | |
- staging | ||
paths: | ||
- 'app/client/**' | ||
- 'docker/Dockerfile.client' | ||
|
||
jobs: | ||
build: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,8 @@ on: | |
branches: | ||
- prod | ||
paths: | ||
- 'app/client/**' | ||
- 'app/client/**' | ||
- 'docker/Dockerfile.client' | ||
env: | ||
PROJECT_ID: ${{ secrets.GKE_PROJECT_ID }} | ||
GKE_CLUSTER: prytaneum-dev-cluster | ||
|
@@ -24,28 +25,32 @@ jobs: | |
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- id: 'auth' | ||
uses: 'google-github-actions/[email protected]' | ||
with: | ||
credentials_json: '${{ secrets.GKE_SA_KEY }}' | ||
|
||
# Setup gcloud CLI | ||
- uses: google-github-actions/[email protected] | ||
- name: 'Set up Cloud SDK' | ||
uses: google-github-actions/[email protected] | ||
with: | ||
service_account_key: ${{ secrets.GKE_SA_KEY }} | ||
project_id: ${{ secrets.GKE_PROJECT_ID }} | ||
|
||
# Configure Docker to use the gcloud command-line tool as a credential | ||
# helper for authentication | ||
- run: |- | ||
gcloud --quiet auth configure-docker | ||
# Get the GKE credentials so we can deploy to the cluster | ||
- uses: google-github-actions/[email protected] | ||
- id: 'get-credentials' | ||
uses: google-github-actions/[email protected] | ||
with: | ||
cluster_name: ${{ env.GKE_CLUSTER }} | ||
location: ${{ env.GKE_ZONE }} | ||
credentials: ${{ secrets.GKE_SA_KEY }} | ||
|
||
# Build the Client | ||
- name: Build Client | ||
if: steps.changes.outputs.client == 'true' | ||
run: |- | ||
docker build \ | ||
-f ./docker/Dockerfile.client \ | ||
|
@@ -59,19 +64,16 @@ jobs: | |
# Push the Client image to Google Container Registry | ||
- name: Publish Client | ||
if: steps.changes.outputs.client == 'true' | ||
run: docker push "gcr.io/$PROJECT_ID/$CLIENT_IMAGE:$GITHUB_SHA" | ||
|
||
# Set up kustomize | ||
- name: Set up Kustomize | ||
if: steps.changes.outputs.client == 'true' | ||
run: |- | ||
curl -sfLo kustomize https://github.com/kubernetes-sigs/kustomize/releases/download/v3.1.0/kustomize_3.1.0_linux_amd64 | ||
chmod u+x ./kustomize | ||
# Deploy the Docker image to the GKE cluster | ||
- name: Kustomize & Deploy Client | ||
if: steps.changes.outputs.client == 'true' | ||
run: |- | ||
cd ./k8s/client/production | ||
kustomize edit set image gcr.io/PROJECT_ID/CLIENT_IMAGE:TAG=gcr.io/$PROJECT_ID/$CLIENT_IMAGE:$GITHUB_SHA | ||
|
@@ -86,34 +88,29 @@ jobs: | |
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- id: 'auth' | ||
uses: 'google-github-actions/[email protected]' | ||
with: | ||
credentials_json: '${{ secrets.GKE_SA_KEY }}' | ||
|
||
# Setup gcloud CLI | ||
- uses: google-github-actions/[email protected] | ||
- name: 'Set up Cloud SDK' | ||
uses: google-github-actions/[email protected] | ||
with: | ||
service_account_key: ${{ secrets.GKE_SA_KEY }} | ||
project_id: ${{ secrets.GKE_PROJECT_ID }} | ||
|
||
# Configure Docker to use the gcloud command-line tool as a credential | ||
# helper for authentication | ||
- run: |- | ||
gcloud --quiet auth configure-docker | ||
# Get the GKE credentials so we can deploy to the cluster | ||
- uses: google-github-actions/[email protected] | ||
# Get the GKE credentials | ||
- id: 'get-credentials' | ||
uses: google-github-actions/[email protected] | ||
with: | ||
cluster_name: ${{ env.GKE_CLUSTER }} | ||
location: ${{ env.GKE_ZONE }} | ||
credentials: ${{ secrets.GKE_SA_KEY }} | ||
|
||
- name: Kustomize & Deploy Ingress | ||
run: |- | ||
cd ./k8s/ingress/production | ||
kubectl apply -f ./prytaneum-ingress.yml | ||
- name: Deploy Certificate | ||
run: |- | ||
cd ./k8s/cert | ||
kubectl apply -f ./prytaneum-managed-certificate-dev.yml | ||
|
||
- name: Set kubectl context | ||
run: |- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ on: | |
- staging | ||
paths: | ||
- 'app/client/**' | ||
- 'docker/Dockerfile.client' | ||
|
||
env: | ||
PROJECT_ID: ${{ secrets.GKE_PROJECT_ID }} | ||
|
@@ -27,22 +28,27 @@ jobs: | |
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- id: 'auth' | ||
uses: 'google-github-actions/[email protected]' | ||
with: | ||
credentials_json: '${{ secrets.GKE_SA_KEY }}' | ||
|
||
# Setup gcloud CLI | ||
- uses: google-github-actions/[email protected] | ||
- name: 'Set up Cloud SDK' | ||
uses: google-github-actions/[email protected] | ||
with: | ||
service_account_key: ${{ secrets.GKE_SA_KEY }} | ||
project_id: ${{ secrets.GKE_PROJECT_ID }} | ||
|
||
# Configure Docker to use the gcloud command-line tool as a credential | ||
# helper for authentication | ||
- run: |- | ||
gcloud --quiet auth configure-docker | ||
# Get the GKE credentials so we can deploy to the cluster | ||
- uses: google-github-actions/[email protected] | ||
- id: 'get-credentials' | ||
uses: google-github-actions/[email protected] | ||
with: | ||
cluster_name: ${{ env.GKE_CLUSTER }} | ||
location: ${{ env.GKE_ZONE }} | ||
credentials: ${{ secrets.GKE_SA_KEY }} | ||
|
||
# Build the Client | ||
- name: Build Client | ||
|
@@ -83,34 +89,29 @@ jobs: | |
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- id: 'auth' | ||
uses: 'google-github-actions/[email protected]' | ||
with: | ||
credentials_json: '${{ secrets.GKE_SA_KEY }}' | ||
|
||
# Setup gcloud CLI | ||
- uses: google-github-actions/[email protected] | ||
- name: 'Set up Cloud SDK' | ||
uses: google-github-actions/[email protected] | ||
with: | ||
service_account_key: ${{ secrets.GKE_SA_KEY }} | ||
project_id: ${{ secrets.GKE_PROJECT_ID }} | ||
|
||
# Configure Docker to use the gcloud command-line tool as a credential | ||
# helper for authentication | ||
- run: |- | ||
gcloud --quiet auth configure-docker | ||
# Get the GKE credentials so we can deploy to the cluster | ||
- uses: google-github-actions/[email protected] | ||
# Get the GKE credentials | ||
- id: 'get-credentials' | ||
uses: google-github-actions/[email protected] | ||
with: | ||
cluster_name: ${{ env.GKE_CLUSTER }} | ||
location: ${{ env.GKE_ZONE }} | ||
credentials: ${{ secrets.GKE_SA_KEY }} | ||
|
||
- name: Kustomize & Deploy Ingress | ||
run: |- | ||
cd ./k8s/ingress/development | ||
kubectl apply -f ./prytaneum-ingress.yml | ||
- name: Deploy Certificate | ||
run: |- | ||
cd ./k8s/cert | ||
kubectl apply -f ./prytaneum-managed-certificate-dev.yml | ||
|
||
- name: Set kubectl context | ||
run: |- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Deploy prod ingress | ||
|
||
on: | ||
push: | ||
branches: | ||
- prod | ||
paths: | ||
- 'k8s/ingress/production/**' | ||
- 'k8s/cert/**' | ||
|
||
env: | ||
GKE_CLUSTER: prytaneum-dev-cluster | ||
GKE_ZONE: us-central1-a | ||
NAMESPACE: development | ||
GOOGLE_ANALYTICS_ID: ${{ secrets.DEV_GOOGLE_ANALYTICS_ID }} | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy | ||
runs-on: ubuntu-latest | ||
environment: development | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- id: 'auth' | ||
uses: 'google-github-actions/[email protected]' | ||
with: | ||
credentials_json: '${{ secrets.GKE_SA_KEY }}' | ||
|
||
# Setup gcloud CLI | ||
- name: 'Set up Cloud SDK' | ||
uses: google-github-actions/[email protected] | ||
with: | ||
project_id: ${{ secrets.GKE_PROJECT_ID }} | ||
|
||
# Configure Docker to use the gcloud command-line tool as a credential | ||
# helper for authentication | ||
- run: |- | ||
gcloud --quiet auth configure-docker | ||
# Get the GKE credentials so we can deploy to the cluster | ||
- id: 'get-credentials' | ||
uses: google-github-actions/[email protected] | ||
with: | ||
cluster_name: ${{ env.GKE_CLUSTER }} | ||
location: ${{ env.GKE_ZONE }} | ||
|
||
- name: Kustomize & Deploy Ingress | ||
run: |- | ||
cd ./k8s/ingress/development | ||
kubectl apply -f ./prytaneum-ingress.yml | ||
- name: Deploy Certificate | ||
run: |- | ||
cd ./k8s/cert | ||
kubectl apply -f ./prytaneum-managed-certificate-dev.yml | ||
- name: Set kubectl context | ||
run: |- | ||
kubectl config set-context --current --namespace=$NAMESPACE | ||
- name: Deployment Rollout Check | ||
run: |- | ||
kubectl get services -o wide |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Deploy staging ingress | ||
|
||
on: | ||
push: | ||
branches: | ||
- staging | ||
paths: | ||
- 'k8s/ingress/development/**' | ||
- 'k8s/cert/**' | ||
|
||
env: | ||
GKE_CLUSTER: prytaneum-dev-cluster | ||
GKE_ZONE: us-central1-a | ||
NAMESPACE: development | ||
GOOGLE_ANALYTICS_ID: ${{ secrets.DEV_GOOGLE_ANALYTICS_ID }} | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy | ||
runs-on: ubuntu-latest | ||
environment: development | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- id: 'auth' | ||
uses: 'google-github-actions/[email protected]' | ||
with: | ||
credentials_json: '${{ secrets.GKE_SA_KEY }}' | ||
|
||
# Setup gcloud CLI | ||
- name: 'Set up Cloud SDK' | ||
uses: google-github-actions/[email protected] | ||
with: | ||
project_id: ${{ secrets.GKE_PROJECT_ID }} | ||
|
||
# Configure Docker to use the gcloud command-line tool as a credential | ||
# helper for authentication | ||
- run: |- | ||
gcloud --quiet auth configure-docker | ||
# Get the GKE credentials so we can deploy to the cluster | ||
- id: 'get-credentials' | ||
uses: google-github-actions/[email protected] | ||
with: | ||
cluster_name: ${{ env.GKE_CLUSTER }} | ||
location: ${{ env.GKE_ZONE }} | ||
|
||
- name: Kustomize & Deploy Ingress | ||
run: |- | ||
cd ./k8s/ingress/development | ||
kubectl apply -f ./prytaneum-ingress.yml | ||
- name: Deploy Certificate | ||
run: |- | ||
cd ./k8s/cert | ||
kubectl apply -f ./prytaneum-managed-certificate-dev.yml | ||
- name: Set kubectl context | ||
run: |- | ||
kubectl config set-context --current --namespace=$NAMESPACE | ||
- name: Deployment Rollout Check | ||
run: |- | ||
kubectl get services -o wide |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ on: | |
- staging | ||
paths: | ||
- 'app/server/**' | ||
- 'docker/Dockerfile.server' | ||
|
||
jobs: | ||
build: | ||
|
Oops, something went wrong.