Skip to content

Commit

Permalink
Merge pull request #595 from knowit/fix/9-opprette-opprette-AD-pålogging
Browse files Browse the repository at this point in the history
[Fix] Opprette AD pålogging
  • Loading branch information
joacimds committed Jun 11, 2024
2 parents 48448b5 + 8c65687 commit fe066f1
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 3 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/deploy-dev-force.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,39 @@ name: Deploy - Dev Force
on:
workflow_dispatch:

env:
REACT_APP_ENV: development

jobs:
deploy_server:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: master

- name: Set up node 18
uses: actions/setup-node@v3
with:
node-version: "18"

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}
aws-region: eu-central-1

- name: Install serverless
run: npm install -g serverless@3.25.1

- name: Install server dependencies
run: yarn workspaces focus server

- uses: softprops/turnstyle@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Deploy server
run: serverless deploy --stage dev --force

Expand All @@ -38,28 +47,39 @@ jobs:
- uses: actions/checkout@v4
with:
ref: master

- name: Set up node 18
uses: actions/setup-node@v3
with:
node-version: "18"

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}
aws-region: eu-central-1

- name: Add env variable to .env file
working-directory: ./apps/web
run: echo "REACT_APP_ENV=$REACT_APP_ENV" >> .env

- name: Install dependencies
working-directory: apps/web
run: yarn install

- uses: softprops/turnstyle@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build web
working-directory: apps/web
run: yarn predeploy:dev

- name: Deploy web
working-directory: apps/web
run: yarn deploy:dev

- name: Update invalidation
working-directory: apps/web
run: yarn postdeploy:dev
21 changes: 21 additions & 0 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,37 @@ on:
types: [published]
workflow_dispatch:

env:
REACT_APP_ENV: production

jobs:
deploy_server:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up node 18
uses: actions/setup-node@v3
with:
node-version: "18"

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-central-1

- name: Install serverless
run: npm install -g serverless@3.25.1

- name: Install server dependencies
run: yarn workspaces focus server

- uses: softprops/turnstyle@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Deploy server
run: serverless deploy --stage prod

Expand All @@ -35,28 +44,39 @@ jobs:
needs: deploy_server
steps:
- uses: actions/checkout@v2

- name: Set up node 18
uses: actions/setup-node@v3
with:
node-version: "18"

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-central-1

- name: Add env variable to .env file
working-directory: ./apps/web
run: echo "REACT_APP_ENV=$REACT_APP_ENV" >> .env

- name: Install dependencies
working-directory: apps/web
run: yarn install

- uses: softprops/turnstyle@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build web
working-directory: apps/web
run: yarn predeploy:prod

- name: Deploy web
working-directory: apps/web
run: yarn deploy:prod

- name: Update invalidation
working-directory: apps/web
run: yarn postdeploy:prod
Expand All @@ -68,6 +88,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/config/envs/prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineConfig } from '../defineConfig'
export function createProdConfig() {
return defineConfig({
env: 'production',
oauthDomain: 'https://auth.knowit.no/',
oauthDomain: 'prod-folk-user-pool.auth.eu-central-1.amazoncognito.com',
redirectUrls: ['https://folk.knowit.no/'],
userPoolClientId: '4447oe7lraspnfmetdd5bv431c',
userPoolId: 'eu-central-1_774ftywyI',
Expand Down
2 changes: 0 additions & 2 deletions apps/web/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { createProdConfig } from './envs/prod'
export const appConfig = getConfig()

function getConfig() {
console.log('NODE_ENV:', process.env.NODE_ENV)
console.log('Environment:', process.env.REACT_APP_ENV)
switch (process.env.REACT_APP_ENV) {
case 'production':
return createProdConfig()
Expand Down

0 comments on commit fe066f1

Please sign in to comment.