diff --git a/.github/workflows/deploy.dev.yml b/.github/workflows/deploy.dev.yml index 8a8ca11..f1d0ba0 100644 --- a/.github/workflows/deploy.dev.yml +++ b/.github/workflows/deploy.dev.yml @@ -45,6 +45,9 @@ jobs: name: Deploying to Cloud.gov runs-on: ubuntu-latest needs: docker + env: + LOGIN_PRIVATE_KEY: | + ${{ secrets.LOGIN_PRIVATE_DEV_KEY }} steps: - name: Checkout diff --git a/server/routes/auth.routes.js b/server/routes/auth.routes.js index 870bde7..88cbe8c 100644 --- a/server/routes/auth.routes.js +++ b/server/routes/auth.routes.js @@ -41,7 +41,12 @@ const CO_ROLE = 3 const EXEC_ROLE = 4 // Load your RSA private key -const privateKey = fs.readFileSync(path.resolve(__dirname,'../certs/private.pem'), 'utf8'); +let privateKey; +try { + privateKey = fs.readFileSync(path.resolve(__dirname,'../certs/private.pem'), 'utf8'); +} catch (err) { + privateKey = process.env.LOGIN_PRIVATE_KEY; +} const publicKey = fs.readFileSync(path.resolve(__dirname,'../certs/public.crt'), 'utf8'); /** * Update a user record in the database to reflect updated info from MAX CAS