-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/user-auth
# Conflicts: # .github/actions/build-and-deploy-api/action.yml # .github/workflows/next-deployment.yml # apps/api/.env.template # apps/api/src/app/app.module.ts # package-lock.json
- Loading branch information
Showing
48 changed files
with
2,075 additions
and
2,102 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
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 |
---|---|---|
@@ -1,25 +1,28 @@ | ||
name: 'build-and-deploy-spa' | ||
description: 'Builds SPA Project for Production and Deploys it to a given SWA Environment' | ||
description: 'Builds SPA project for production and deploys it to a given environment' | ||
|
||
inputs: | ||
apiUrl: | ||
required: true | ||
description: "Base URL of the API" | ||
oauthConfig: | ||
required: true | ||
description: "OAuthConfig from the angular-oauth2-oidc package" | ||
releaseVersion: | ||
required: true | ||
description: "Release Version (Commit or Tag)" | ||
deploymentEnv: | ||
required: true | ||
description: "Deployment Environment" | ||
sentryKey: | ||
required: true | ||
description: "Sentry DSN Key" | ||
sentryAuthToken: | ||
required: true | ||
description: "Sentry Auth Token" | ||
containerRegistryUrl: | ||
required: true | ||
description: "Container registry url" | ||
containerRegistryUsername: | ||
required: true | ||
description: "Container registry username" | ||
containerRegistryPassword: | ||
required: true | ||
description: "Container registry password" | ||
containerTag: | ||
required: true | ||
description: "Container tag" | ||
outputs: | ||
url: | ||
description: "SPA URL" | ||
|
@@ -28,25 +31,38 @@ outputs: | |
runs: | ||
using: "composite" | ||
steps: | ||
- name: Generate Third-Party Licenses | ||
run: npx --yes [email protected] --input package.json --output apps/spa/src/assets/third-party-licenses.txt --ci | ||
shell: bash | ||
- run: | | ||
envsubst < apps/spa/src/environments/environment.template > apps/spa/src/environments/environment.prod.ts | ||
npx nx build spa --prod | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ inputs.containerRegistryUrl }} | ||
username: ${{ inputs.containerRegistryUsername }} | ||
password: ${{ inputs.containerRegistryPassword }} | ||
- run: envsubst < apps/spa/src/environments/environment.template > apps/spa/src/environments/environment.ts | ||
shell: bash | ||
env: | ||
IS_PRODUCTION: true | ||
ENVIRONMENT_NAME: ${{ inputs.deploymentEnv }} | ||
API_URL: ${{ inputs.apiUrl }} | ||
OAUTH_CONFIG: ${{ inputs.oauthConfig }} | ||
RELEASE_VERSION: ${{ inputs.releaseVersion }} | ||
SENTRY_KEY: ${{ inputs.sentryKey }} | ||
- run: | | ||
npx nx build spa --prod | ||
npx --yes [email protected] --input package.json --output dist/apps/spa/browser/assets/third-party-licenses.txt --ci | ||
shell: bash | ||
- name: Build and push image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ./ | ||
file: ./apps/spa/docker/Dockerfile | ||
push: true | ||
tags: | | ||
${{ inputs.containerTag }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
- name: Deploy SPA | ||
id: spa-deployment | ||
shell: bash | ||
run: echo "url=placeholder" >> $GITHUB_OUTPUT | ||
- name: Build SPA with source maps | ||
- name: Build SPA with source maps for sentry | ||
run: npx nx build spa --prod --source-map=true | ||
shell: bash | ||
- name: Create Sentry release | ||
|
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
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 |
---|---|---|
|
@@ -17,7 +17,7 @@ jobs: | |
node-version-file: '.nvmrc' | ||
cache: 'npm' | ||
- run: npm ci | ||
- uses: timonmasberg/[email protected].8 | ||
- uses: timonmasberg/[email protected].12 | ||
with: | ||
repoToken: ${{ secrets.WORKFLOW_PAT }} | ||
prTitle: 'chore(deps): migrate nx to $VERSION' |
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 |
---|---|---|
|
@@ -81,23 +81,25 @@ jobs: | |
id: api-deployment | ||
uses: ./.github/actions/build-and-deploy-api | ||
with: | ||
slot: "pr${{ github.event.issue.number }}" | ||
deploymentEnv: "pr${{ github.event.issue.number }}" | ||
releaseVersion: ${{ steps.set-pr-sha.outputs.head_sha }} | ||
sentryKey: ${{ secrets.API_SENTRY_KEY }} | ||
sentryAuthToken: ${{ secrets.SENTRY_AUTH_TOKEN }} | ||
containerRegistryUrl: ghcr.io | ||
containerRegistryUsername: ${{ github.actor }} | ||
containerRegistryPassword: ${{ secrets.GITHUB_TOKEN }} | ||
containerTag: ghcr.io/kordis-leitstelle/kordis-api:${{ steps.set-pr-sha.outputs.head_sha }} | ||
|
||
- name: Build and Deploy SPA | ||
id: spa-deployment | ||
uses: ./.github/actions/build-and-deploy-spa | ||
with: | ||
apiUrl: ${{ steps.api-deployment.outputs.url }} | ||
oauthConfig: ${{ secrets.DEV_OAUTH_CONFIG }} | ||
releaseVersion: ${{ steps.set-pr-sha.outputs.head_sha }} | ||
deploymentEnv: "pr${{ github.event.issue.number }}" | ||
sentryKey: ${{ secrets.SPA_SENTRY_KEY }} | ||
sentryAuthToken: ${{ secrets.SENTRY_AUTH_TOKEN }} | ||
containerRegistryUrl: ghcr.io | ||
containerRegistryUsername: ${{ github.actor }} | ||
containerRegistryPassword: ${{ secrets.GITHUB_TOKEN }} | ||
containerTag: ghcr.io/kordis-leitstelle/kordis-spa:${{ steps.set-pr-sha.outputs.head_sha }} | ||
- name: Update PR Preview Comment | ||
uses: peter-evans/[email protected] | ||
with: | ||
|
@@ -110,7 +112,7 @@ jobs: | |
Commit SHA: ${{ steps.set-pr-sha.outputs.head_sha }} | ||
reactions: "rocket" | ||
- name: AZ B2C Tenant Login | ||
uses: azure/login@v1.5.1 | ||
uses: azure/login@v1.6.1 | ||
with: | ||
creds: '${{ secrets.AZURE_AADB2C_CREDENTIALS }}' | ||
allow-no-subscriptions: true | ||
|
@@ -163,23 +165,25 @@ jobs: | |
id: api-deployment | ||
uses: ./.github/actions/build-and-deploy-api | ||
with: | ||
slot: "pr${{ github.event.pull_request.number }}" | ||
deploymentEnv: "pr${{ github.event.pull_request.number }}" | ||
releaseVersion: ${{ github.event.pull_request.head.sha }} | ||
sentryKey: ${{ secrets.API_SENTRY_KEY }} | ||
sentryAuthToken: ${{ secrets.SENTRY_AUTH_TOKEN }} | ||
containerRegistryUrl: ghcr.io | ||
containerRegistryUsername: ${{ github.actor }} | ||
containerRegistryPassword: ${{ secrets.GITHUB_TOKEN }} | ||
containerTag: ghcr.io/kordis-leitstelle/kordis-api:${{ github.event.pull_request.head.sha }} | ||
- name: Build and Deploy SPA | ||
id: spa-deployment | ||
uses: ./.github/actions/build-and-deploy-spa | ||
with: | ||
apiUrl: ${{ steps.api-deployment.outputs.url }} | ||
oauthConfig: ${{ secrets.DEV_OAUTH_CONFIG }} | ||
releaseVersion: ${{ github.event.pull_request.head.sha }} | ||
releaseVersion: ${{ github.event.pull_request.head.sha }} | ||
deploymentEnv: "pr${{ github.event.pull_request.number }}" | ||
sentryKey: ${{ secrets.SPA_SENTRY_KEY }} | ||
sentryAuthToken: ${{ secrets.SENTRY_AUTH_TOKEN }} | ||
containerRegistryUrl: ghcr.io | ||
containerRegistryUsername: ${{ github.actor }} | ||
containerRegistryPassword: ${{ secrets.GITHUB_TOKEN }} | ||
containerTag: ghcr.io/kordis-leitstelle/kordis-spa:${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Update PR Preview Comment | ||
uses: peter-evans/[email protected] | ||
with: | ||
|
@@ -217,7 +221,7 @@ jobs: | |
🏁 This PR has been closed. No deployment preview is available. | ||
reactions: "hooray" | ||
- name: AZ B2C Tenant Login | ||
uses: azure/login@v1.5.1 | ||
uses: azure/login@v1.6.1 | ||
with: | ||
creds: '${{ secrets.AZURE_AADB2C_CREDENTIALS }}' | ||
allow-no-subscriptions: true | ||
|
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
Oops, something went wrong.