Skip to content

Commit

Permalink
fix (#270)
Browse files Browse the repository at this point in the history
* 1. modified directory structure.

Signed-off-by: OMPRAKASH MISHRA <omprakashmishra3978@gmail.com>

* 1. Add prod deployment to merge

Signed-off-by: OMPRAKASH MISHRA <omprakashmishra3978@gmail.com>

---------

Signed-off-by: OMPRAKASH MISHRA <omprakashmishra3978@gmail.com>
  • Loading branch information
mishraomp authored Oct 17, 2023
1 parent e1921f3 commit 00e3156
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 5 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/merge-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,35 @@ jobs:
name: cypress-screenshots
path: ./frontend/cypress/screenshots
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn`
deploys-prod:
name: PROD Deployments
needs: [semantic-version,cypress-e2e]
environment: prod
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Deploy
shell: bash
run: |
# Allow pipefail, since we could be catching oc create errors
set +o pipefail
# Login to OpenShift (NOTE: project command is a safeguard)
oc login --token=${{ secrets.oc_token }} --server=${{ vars.oc_server }}
oc project ${{ vars.oc_namespace }}
# Deploy Helm Chart
cd charts/pubcode
helm dependency update
helm upgrade --install --wait --atomic pubcode --values values.yaml --set-string global.repository=${{ github.repository }} --set-string api.containers[0].tag="${{ needs.semantic-version.outputs.semanticVersion }}" --set-string frontend.containers[0].tag="${{ needs.semantic-version.outputs.semanticVersion }}" --set-string global.secrets.emailRecipients="${{ secrets.EMAIL_RECIPIENTS }}" --set-string global.secrets.chesTokenURL="${{ secrets.CHES_TOKEN_URL }}" --set-string global.secrets.chesClientID="${{ secrets.CHES_CLIENT_ID }}" --set-string global.secrets.chesClientSecret="${{ secrets.CHES_CLIENT_SECRET }}" --set-string global.secrets.chesAPIURL="${{ secrets.CHES_API_URL }}" --set-string global.secrets.databaseAdminPassword="${{ secrets.DB_PWD }}" --set-string namespace="${{ vars.oc_namespace }}" --timeout 5m .
- name: Create Release
uses: softprops/action-gh-release@v1
continue-on-error: true
env:
GITHUB_TOKEN: ${{ github.token }}
with:
token: ${{ github.token }}
tag_name: ${{ github.event.inputs.tag }}
name: Release-${{ github.event.inputs.tag }}
10 changes: 5 additions & 5 deletions .github/workflows/remove-deleted-repos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ jobs:
soft-delete-removed-pubcodes:
name: Soft Delete pubcodes In the Databse which are removed from the repo.
runs-on: ubuntu-22.04
defaults:
run:
working-directory: utilities/remove-deleted-pubcode
environment: prod
steps:
- name: Check out repository
Expand All @@ -19,9 +22,7 @@ jobs:
with:
node-version: "20.x"
- name: Install Dependencies
run: |
cd utilities
npm ci
run: npm ci

- uses: actions/cache@v3
with:
Expand All @@ -32,11 +33,10 @@ jobs:
- name: Process script
run: |
cd utilities
oc login --token=${{ secrets.OC_TOKEN }} --server=${{ vars.OC_SERVER }}
oc project ${{ vars.OC_NAMESPACE }}
# Get API key
API_KEY=$(oc get secrets/pubcode --template={{.data.API_KEY}} | base64 -d)
API_URL=https://$(oc get route/pubcode-api --template={{.spec.host}})
API_KEY="${API_KEY}" API_URL="${API_URL}" node src/remove-deleted-pubcodes.js
API_KEY="${API_KEY}" API_URL="${API_URL}" node index.js
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "utilities",
"version": "1.0.0",
"description": "",
"main": "index.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down

0 comments on commit 00e3156

Please sign in to comment.