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

added ci for demos #366

Merged
merged 26 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e145316
dep updates ci added for react example
himanshuchawla009 Aug 3, 2022
95d6dfc
dep updates ci added for examples
himanshuchawla009 Aug 3, 2022
af7693d
run demo ci on a matrix
himanshuchawla009 Aug 3, 2022
6a4304e
temp test
himanshuchawla009 Aug 3, 2022
fe00f22
run demo ci on release
himanshuchawla009 Aug 3, 2022
ed73503
add action for commiting deps updates
himanshuchawla009 Aug 4, 2022
0b2d293
temp changes
himanshuchawla009 Aug 4, 2022
40bd6b5
Commit from GitHub Actions (Update and Build examples on release)
himanshuchawla009 Aug 4, 2022
591a0dc
commit dep updates on release
himanshuchawla009 Aug 4, 2022
5bec3ba
ci added for deploying demo cognito app
himanshuchawla009 Aug 8, 2022
5cf469d
cognito example fixes
himanshuchawla009 Aug 8, 2022
6fda372
Commit from GitHub Actions (Update, Build and Deploy cognito react ex…
himanshuchawla009 Aug 8, 2022
ff3ab6f
deploy cognito example on release
himanshuchawla009 Aug 8, 2022
2fbbeba
added ci for auth0 example
himanshuchawla009 Aug 8, 2022
31f14e1
dir path fix in auth0 ci
himanshuchawla009 Aug 8, 2022
8a884ca
auth0 example fixes
himanshuchawla009 Aug 8, 2022
2d71bdd
more fixes in auth0 example
himanshuchawla009 Aug 8, 2022
7654ead
Commit from GitHub Actions (Update, Build and Deploy auth0 example)
himanshuchawla009 Aug 8, 2022
5fcf563
deploy demos only on release or with a specific deploy msg
himanshuchawla009 Aug 8, 2022
97f2d41
[deploy-demos] custom ui and plugin demo ci added
himanshuchawla009 Aug 8, 2022
368c53a
[deploy-demos] temp test
himanshuchawla009 Aug 8, 2022
61e659a
[deploy-demos] temp test
himanshuchawla009 Aug 8, 2022
7cc4014
[deploy-demos] temp test
himanshuchawla009 Aug 8, 2022
29bc676
Commit from GitHub Actions (Update, Build and Deploy cognito react ex…
himanshuchawla009 Aug 8, 2022
d41e233
run cognito ci only in master
himanshuchawla009 Aug 8, 2022
587a108
remove duplicate example builds on ci
himanshuchawla009 Aug 16, 2022
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
53 changes: 53 additions & 0 deletions .github/workflows/demo-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Update and Build examples on release

on:
release:
types: [published]
jobs:
demo:
strategy:
matrix:
node: ["16.x"]
os: [ubuntu-latest]
demo: [react-app, next-app, angular-app,firebase-next-app, firebase-react-app, whitelabel-app, starkex-react-app]

runs-on: ${{ matrix.os }}

steps:
- name: Check out Git repository
if: github.ref == 'refs/heads/master'
uses: actions/checkout@v2

- name: Set up node
if: github.ref == 'refs/heads/master'
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
registry-url: "https://registry.npmjs.org"
- name: Build ${{ matrix.demo }} demo
if: github.ref == 'refs/heads/master'
run: |
npm i -g npm-check-updates
cd demo/${{ matrix.demo }}
ncu -u --target=minor
ncu -u "/^@web3auth.*$/"
npm install
npm run build
- name: Commit Changes
if: github.ref == 'refs/heads/master'
uses: EndBug/add-and-commit@v9 # You can change this to use a specific version.
with:
# Determines the way the action fills missing author name and email. Three options are available:
# - github_actor -> UserName <UserName@users.noreply.github.com>
# - user_info -> Your Display Name <your-actual@email.com>
# - github_actions -> github-actions <email associated with the github logo>
# Default: github_actor
default_author: user_info

# The way the action should handle pathspec errors from the add and remove commands. Three options are available:
# - ignore -> errors will be logged but the step won't fail
# - exitImmediately -> the action will stop right away, and the step will fail
# - exitAtEnd -> the action will go on, every pathspec error will be logged at the end, the step will fail.
# Default: ignore
pathspec_error_handling: exitImmediately

88 changes: 88 additions & 0 deletions .github/workflows/deploy-auth0-demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Update, Build and Deploy auth0 example

on:
release:
types: [published]
push:
branches: [master]
jobs:
auth0-react-app:
strategy:
matrix:
node: ["16.x"]
os: [ubuntu-latest]
demo: [auth0-react-app]

runs-on: ${{ matrix.os }}

steps:
- name: Check out Git repository
if: ((github.ref == 'refs/heads/master' && github.event_name == 'release') || (github.ref == 'refs/heads/master' && github.event_name == 'push' && contains(github.event.head_commit.message, '[deploy-demos]')))

uses: actions/checkout@v2

- name: Set up node
if: ((github.ref == 'refs/heads/master' && github.event_name == 'release') || (github.ref == 'refs/heads/master' && github.event_name == 'push' && contains(github.event.head_commit.message, '[deploy-demos]')))
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
registry-url: "https://registry.npmjs.org"
- name: Build ${{ matrix.demo }} demo
if: ((github.ref == 'refs/heads/master' && github.event_name == 'release') || (github.ref == 'refs/heads/master' && github.event_name == 'push' && contains(github.event.head_commit.message, '[deploy-demos]')))
run: |
npm i -g npm-check-updates
cd demo/${{ matrix.demo }}/app
ncu -u --target=minor
ncu -u "/^@web3auth.*$/"
npm install
npm run build
- name: Commit Changes
if: ((github.ref == 'refs/heads/master' && github.event_name == 'release') || (github.ref == 'refs/heads/master' && github.event_name == 'push' && contains(github.event.head_commit.message, '[deploy-demos]')))
uses: EndBug/add-and-commit@v9 # You can change this to use a specific version.
with:
# Determines the way the action fills missing author name and email. Three options are available:
# - github_actor -> UserName <UserName@users.noreply.github.com>
# - user_info -> Your Display Name <your-actual@email.com>
# - github_actions -> github-actions <email associated with the github logo>
# Default: github_actor
default_author: user_info

# The way the action should handle pathspec errors from the add and remove commands. Three options are available:
# - ignore -> errors will be logged but the step won't fail
# - exitImmediately -> the action will stop right away, and the step will fail
# - exitAtEnd -> the action will go on, every pathspec error will be logged at the end, the step will fail.
# Default: ignore
pathspec_error_handling: exitImmediately

# Set the credentials from repository settings/secrets
- name: Configure AWS credentials
if: ((github.ref == 'refs/heads/master' && github.event_name == 'release') || (github.ref == 'refs/heads/master' && github.event_name == 'push' && contains(github.event.head_commit.message, '[deploy-demos]')))
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: ${{ secrets.AWS_REGION_US }}

# Copy the files from build folder to the S3 bucket
# Upload to S3
- name: sync s3
if: ((github.ref == 'refs/heads/master' && github.event_name == 'release') || (github.ref == 'refs/heads/master' && github.event_name == 'push' && contains(github.event.head_commit.message, '[deploy-demos]')))
uses: jakejarvis/s3-sync-action@master
env:
SOURCE_DIR: "./demo/auth0-react-app/app/build"
AWS_REGION: "us-east-1"
AWS_S3_BUCKET: "demo-auth0.web3auth.io"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

# Invalidate Cloudfront (this action)
- name: invalidate
if: ((github.ref == 'refs/heads/master' && github.event_name == 'release') || (github.ref == 'refs/heads/master' && github.event_name == 'push' && contains(github.event.head_commit.message, '[deploy-demos]')))
uses: chetan/invalidate-cloudfront-action@master
env:
DISTRIBUTION: ${{ secrets.AWS_CLOUDFRONT_AUTH0_DEMO_DISTRIBUTION_ID }}
PATHS: "/*"
AWS_REGION: ${{ secrets.AWS_REGION_US }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

87 changes: 87 additions & 0 deletions .github/workflows/deploy-cognito-demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Update, Build and Deploy cognito react example

on:
release:
types: [published]
push:
branches: [master]
jobs:
cognito-react-app:
strategy:
matrix:
node: ["16.x"]
os: [ubuntu-latest]
demo: [cognito-react-app]

runs-on: ${{ matrix.os }}

steps:
- name: Check out Git repository
if: ((github.ref == 'refs/heads/master' && github.event_name == 'release') || (github.ref == 'refs/heads/master' && github.event_name == 'push' && contains(github.event.head_commit.message, '[deploy-demos]')))
uses: actions/checkout@v2

- name: Set up node
if: ((github.ref == 'refs/heads/master' && github.event_name == 'release') || (github.ref == 'refs/heads/master' && github.event_name == 'push' && contains(github.event.head_commit.message, '[deploy-demos]')))
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
registry-url: "https://registry.npmjs.org"
- name: Build ${{ matrix.demo }} demo
if: ((github.ref == 'refs/heads/master' && github.event_name == 'release') || (github.ref == 'refs/heads/master' && github.event_name == 'push' && contains(github.event.head_commit.message, '[deploy-demos]')))
run: |
npm i -g npm-check-updates
cd demo/${{ matrix.demo }}
ncu -u --target=minor
ncu -u "/^@web3auth.*$/"
npm install
npm run build
- name: Commit Changes
if: ((github.ref == 'refs/heads/master' && github.event_name == 'release') || (github.ref == 'refs/heads/master' && github.event_name == 'push' && contains(github.event.head_commit.message, '[deploy-demos]')))
uses: EndBug/add-and-commit@v9 # You can change this to use a specific version.
with:
# Determines the way the action fills missing author name and email. Three options are available:
# - github_actor -> UserName <UserName@users.noreply.github.com>
# - user_info -> Your Display Name <your-actual@email.com>
# - github_actions -> github-actions <email associated with the github logo>
# Default: github_actor
default_author: user_info

# The way the action should handle pathspec errors from the add and remove commands. Three options are available:
# - ignore -> errors will be logged but the step won't fail
# - exitImmediately -> the action will stop right away, and the step will fail
# - exitAtEnd -> the action will go on, every pathspec error will be logged at the end, the step will fail.
# Default: ignore
pathspec_error_handling: exitImmediately

# Set the credentials from repository settings/secrets
- name: Configure AWS credentials
if: ((github.ref == 'refs/heads/master' && github.event_name == 'release') || (github.ref == 'refs/heads/master' && github.event_name == 'push' && contains(github.event.head_commit.message, '[deploy-demos]')))
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: ${{ secrets.AWS_REGION_US }}

# Copy the files from build folder to the S3 bucket
# Upload to S3
- name: sync s3
if: ((github.ref == 'refs/heads/master' && github.event_name == 'release') || (github.ref == 'refs/heads/master' && github.event_name == 'push' && contains(github.event.head_commit.message, '[deploy-demos]')))
uses: jakejarvis/s3-sync-action@master
env:
SOURCE_DIR: "./demo/cognito-react-app/build"
AWS_REGION: "us-east-1"
AWS_S3_BUCKET: "demo-cognito.web3auth.io"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

# Invalidate Cloudfront (this action)
- name: invalidate
if: ((github.ref == 'refs/heads/master' && github.event_name == 'release') || (github.ref == 'refs/heads/master' && github.event_name == 'push' && contains(github.event.head_commit.message, '[deploy-demos]')))
uses: chetan/invalidate-cloudfront-action@master
env:
DISTRIBUTION: ${{ secrets.AWS_CLOUDFRONT_COGNITO_DEMO_DISTRIBUTION_ID }}
PATHS: "/*"
AWS_REGION: ${{ secrets.AWS_REGION_US }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

87 changes: 87 additions & 0 deletions .github/workflows/deploy-customui-demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Update, Build and Deploy custom ui example

on:
release:
types: [published]
push:
branches: [master]
jobs:
custom-ui-react-app:
strategy:
matrix:
node: ["16.x"]
os: [ubuntu-latest]
demo: [custom-ui-react-app]

runs-on: ${{ matrix.os }}

steps:
- name: Check out Git repository
if: ((github.ref == 'refs/heads/master' && github.event_name == 'release') || (github.ref != 'refs/heads/master' && github.event_name == 'push' && contains(github.event.head_commit.message, '[deploy-demos]')))
uses: actions/checkout@v2

- name: Set up node
if: ((github.ref == 'refs/heads/master' && github.event_name == 'release') || (github.ref != 'refs/heads/master' && github.event_name == 'push' && contains(github.event.head_commit.message, '[deploy-demos]')))
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
registry-url: "https://registry.npmjs.org"
- name: Build ${{ matrix.demo }} demo
if: ((github.ref == 'refs/heads/master' && github.event_name == 'release') || (github.ref != 'refs/heads/master' && github.event_name == 'push' && contains(github.event.head_commit.message, '[deploy-demos]')))
run: |
npm i -g npm-check-updates
cd demo/${{ matrix.demo }}
ncu -u --target=minor
ncu -u "/^@web3auth.*$/"
npm install
npm run build
- name: Commit Changes
if: ((github.ref == 'refs/heads/master' && github.event_name == 'release') || (github.ref != 'refs/heads/master' && github.event_name == 'push' && contains(github.event.head_commit.message, '[deploy-demos]')))
uses: EndBug/add-and-commit@v9 # You can change this to use a specific version.
with:
# Determines the way the action fills missing author name and email. Three options are available:
# - github_actor -> UserName <UserName@users.noreply.github.com>
# - user_info -> Your Display Name <your-actual@email.com>
# - github_actions -> github-actions <email associated with the github logo>
# Default: github_actor
default_author: user_info

# The way the action should handle pathspec errors from the add and remove commands. Three options are available:
# - ignore -> errors will be logged but the step won't fail
# - exitImmediately -> the action will stop right away, and the step will fail
# - exitAtEnd -> the action will go on, every pathspec error will be logged at the end, the step will fail.
# Default: ignore
pathspec_error_handling: exitImmediately

# Set the credentials from repository settings/secrets
- name: Configure AWS credentials
if: ((github.ref == 'refs/heads/master' && github.event_name == 'release') || (github.ref != 'refs/heads/master' && github.event_name == 'push' && contains(github.event.head_commit.message, '[deploy-demos]')))
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: ${{ secrets.AWS_REGION_US }}

# Copy the files from build folder to the S3 bucket
# Upload to S3
- name: sync s3
if: ((github.ref == 'refs/heads/master' && github.event_name == 'release') || (github.ref != 'refs/heads/master' && github.event_name == 'push' && contains(github.event.head_commit.message, '[deploy-demos]')))
uses: jakejarvis/s3-sync-action@master
env:
SOURCE_DIR: "./demo/custom-ui-react-app/build"
AWS_REGION: "us-east-1"
AWS_S3_BUCKET: "core-demo.web3auth.io"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

# Invalidate Cloudfront (this action)
- name: invalidate
if: ((github.ref == 'refs/heads/master' && github.event_name == 'release') || (github.ref != 'refs/heads/master' && github.event_name == 'push' && contains(github.event.head_commit.message, '[deploy-demos]')))
uses: chetan/invalidate-cloudfront-action@master
env:
DISTRIBUTION: ${{ secrets.AWS_CLOUDFRONT_CORE_DEMO_DISTRIBUTION_ID }}
PATHS: "/*"
AWS_REGION: ${{ secrets.AWS_REGION_US }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

Loading