Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support for Management API CLI #11

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 88 additions & 2 deletions .github/workflows/aws-publish.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: Build and Deploy to AWS S3
on:
push:
pull_request:
branches:
- master # Trigger on PRs targeting 'master' branch
types:
- open
- synchronize
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -43,4 +46,87 @@ jobs:
# Step 6: Upload to S3
- name: Upload to S3
run: |
aws s3 cp ./dist s3://universal-login-sample-app/ --recursive
aws s3 cp ./dist s3://universal-login-sample-app/ --recursive

# - name: Manually create test folders under dist/ (for testing only)
# run: |
# mkdir -p dist/loginid
# mkdir -p dist/login
# # Copy the existing built files into these folders
# cp dist/index.js dist/loginid/index.js
# cp dist/index.css dist/loginid/index.css
# cp dist/index.html dist/loginid/index.html
# cp dist/*.png dist/loginid/
# cp dist/index.js dist/login/index.js
# cp dist/index.css dist/login/index.css
# cp dist/index.html dist/login/index.html
# cp dist/*.png dist/login/
# echo "Created test folders with copied build files:"
# ls -R dist/

# - name: Install jq (if not available)
# run: sudo apt-get install jq -y

# - name: Generate settings JSON files dynamically
# run: |
# for screen_folder in dist/*; do
# if [ -d "$screen_folder" ]; then
# screen_name=$(basename "$screen_folder")
# jq -n --arg screen_name "$screen_name" \
# --arg cdn_url "${{ secrets.CDN_URL }}" \
# --arg js_hash "$jsHash" \
# --arg css_hash "$cssHash" \
# '{
# "rendering_mode": "advanced",
# "context_configuration": [
# "branding.settings",
# "branding.themes.default"
# ],
# "head_tags": [
# {
# "tag": "script",
# "attributes": {
# "src": ($cdn_url + "/" + $screen_name + "/index.js"),
# "integrity": [("sha384-" + $js_hash)],
# "crossorigin": "anonymous"
# }
# },
# {
# "tag": "link",
# "attributes": {
# "href": ($cdn_url + "/" + $screen_name + "/index.css"),
# "rel": "stylesheet",
# "integrity": [("sha384-" + $css_hash)],
# "crossorigin": "anonymous"
# }
# }
# ]
# }' > "$screen_name-settings.json"
# echo "Generated settings file: $screen_name-settings.json"
# cat "$screen_name-settings.json"
# fi
# done

# - name: Install Auth0 CLI
# run: |
# # Download and install Auth0 CLI
# curl -sSfL https://raw.githubusercontent.com/auth0/auth0-cli/main/install.sh | sh -s -- -b .
# # Move it to /usr/local/bin for system-wide access
# sudo mv ./auth0 /usr/local/bin/

# - name: Authorize with Tenant Details
# run: |
# auth0 login \
# --domain ${{ secrets.AUTH0_DOMAIN }} \
# --client-id ${{ secrets.AUTH0_CLIENT_ID }} \
# --client-secret ${{ secrets.AUTH0_CLIENT_SECRET }}

# - name: Update Management API using Auth0 CLI
# run: |
# for screen_folder in dist/*; do
# if [ -d "$screen_folder" ]; then
# screen_name=$(basename "$screen_folder")
# auth0 ul customize --rendering-mode advanced --prompt login-id --screen $screen_name --settings-file "./$screen_name-settings.json"
# echo "Updated Auth0 UI for screen: $screen_name"
# fi
# done