Skip to content

Commit

Permalink
point staging deployments to prod envs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mubangizi committed Mar 19, 2024
1 parent da20c8a commit 6797de3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 25 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- master
- ft-add-actions

jobs:
build_and_deploy_to_production:
Expand Down Expand Up @@ -110,15 +109,8 @@ jobs:
core.setOutput('tag', tag)
}
- name: Create deployment
- name: Update deployment
run: |
kubectl create deployment cranecloud-cms-frontend --image=gcr.io/${{ secrets.GCP_PROJECT_ID }}/cranecloud-cms-frontend:${{ steps.export.outputs.tag }} -n $namespace --replicas=2
- name: Expose deployment
run: |
kubectl create service nodeport cranecloud-cms-frontend --tcp=3000:3000 -n $namespace
# - name: Update deployment
# run: |
# kubectl set image deployment/cranecloud-cms-frontend cranecloud-cms-frontend=gcr.io/${{ secrets.GCP_PROJECT_ID }}/cranecloud-cms-frontend:${{ steps.export.outputs.tag }} -n $namespace
kubectl set image deployment/cranecloud-cms-frontend cranecloud-cms-frontend=gcr.io/${{ secrets.GCP_PROJECT_ID }}/cranecloud-cms-frontend:${{ steps.export.outputs.tag }} -n $namespace
33 changes: 18 additions & 15 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- develop
- ft-add-actions

jobs:
build_and_deploy_staging:
Expand Down Expand Up @@ -70,15 +71,24 @@ jobs:
type=sha
- name: Add Env vars
# env:
# REACT_APP_API_BASE_URL: ${{ secrets.STAGING_REACT_APP_API_BASE_URL }}
# REACT_APP_MIRA_API_URL: ${{ secrets.STAGING_REACT_APP_MIRA_API_URL }}
# REACT_APP_FRONTEND_URL: ${{ secrets.STAGING_REACT_APP_FRONTEND_URL }}
# REACT_APP_DOCS_URL: ${{ secrets.STAGING_REACT_APP_DOCS_URL }}
# REACT_APP_BLOG_URL: ${{ secrets.STAGING_REACT_APP_BLOG_URL }}
# REACT_APP_CRANE_CLOUD_STATUS: ${{ secrets.STAGING_REACT_APP_CRANE_CLOUD_STATUS }}
# REACT_APP_MIRA_DOCS_URL: ${{ secrets.STAGING_REACT_APP_MIRA_DOCS_URL }}
# TODO: revert to the above env vars
env:
REACT_APP_API_BASE_URL: ${{ secrets.STAGING_REACT_APP_API_BASE_URL }}
REACT_APP_MIRA_API_URL: ${{ secrets.STAGING_REACT_APP_MIRA_API_URL }}
REACT_APP_FRONTEND_URL: ${{ secrets.STAGING_REACT_APP_FRONTEND_URL }}
REACT_APP_DOCS_URL: ${{ secrets.STAGING_REACT_APP_DOCS_URL }}
REACT_APP_BLOG_URL: ${{ secrets.STAGING_REACT_APP_BLOG_URL }}
REACT_APP_CRANE_CLOUD_STATUS: ${{ secrets.STAGING_REACT_APP_CRANE_CLOUD_STATUS }}
REACT_APP_MIRA_DOCS_URL: ${{ secrets.STAGING_REACT_APP_MIRA_DOCS_URL }}
REACT_APP_API_BASE_URL: ${{ secrets.PROD_REACT_APP_API_BASE_URL }}
REACT_APP_MIRA_API_URL: ${{ secrets.PROD_REACT_APP_MIRA_API_URL }}
REACT_APP_FRONTEND_URL: ${{ secrets.PROD_REACT_APP_FRONTEND_URL }}
REACT_APP_DOCS_URL: ${{ secrets.PROD_REACT_APP_DOCS_URL }}
REACT_APP_BLOG_URL: ${{ secrets.PROD_REACT_APP_BLOG_URL }}
REACT_APP_CRANE_CLOUD_STATUS: ${{ secrets.PROD_REACT_APP_CRANE_CLOUD_STATUS }}
REACT_APP_MIRA_DOCS_URL: ${{ secrets.PROD_REACT_APP_MIRA_DOCS_URL }}

run: |
chmod +x ./.github/workflows/bin/create_envs.sh
./.github/workflows/bin/create_envs.sh
Expand Down Expand Up @@ -109,13 +119,6 @@ jobs:
core.setOutput('tag', tag)
}
# - name: Create deployment
# run: |
# kubectl create deployment cranecloud-cms-frontend --image=gcr.io/${{ secrets.GCP_PROJECT_ID }}/cranecloud-cms-frontend:${{ steps.export.outputs.tag }} -n $namespace --replicas=2
# - name: Expose deployment
# run: |
# kubectl create service nodeport cranecloud-cms-frontend-service --tcp=3000:3000 -n $namespace

- name: Update deployment
run: |
kubectl set image deployment/cranecloud-cms-frontend cranecloud-cms-frontend=gcr.io/${{ secrets.GCP_PROJECT_ID }}/cranecloud-cms-frontend:${{ steps.export.outputs.tag }} -n $namespace
Expand Down

0 comments on commit 6797de3

Please sign in to comment.