Skip to content

Commit

Permalink
Merge pull request #337 from april/master
Browse files Browse the repository at this point in the history
Completely revamp build system
  • Loading branch information
april authored Jun 29, 2020
2 parents 498a831 + 8abb85a commit 15a85f1
Show file tree
Hide file tree
Showing 24 changed files with 3,997 additions and 2,132 deletions.
5 changes: 4 additions & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ env:
amd: true
browser: true
globals:
ga: true
module: true
process: true
require: true
ga: true
NLX: true
parserOptions:
ecmaVersion: 2015
extends: eslint:recommended
rules:
array-bracket-spacing:
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: auth0-custom-lock
env:
NODE_ENV: 'development'
nodeVersion: '14.x'
pythonVersion: '3.x'
AUTH0_DOMAIN: 'auth-dev.mozilla.auth0.com'
AUTH0_CLIENT_ID: ${{ secrets.DEVELOPMENT_AUTH0_CLIENT_ID }}
AUTH0_CLIENT_SECRET: ${{ secrets.DEVELOPMENT_AUTH0_CLIENT_SECRET }}
AWS_CDN_BUCKET_NAME: ${{ secrets.DEVELOPMENT_AWS_CDN_BUCKET_NAME }}

on:
push:
branches:
- refs/tags/*-pre

jobs:
dev-build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Check for secrets to be set
run: if [ ${#AWS_CDN_BUCKET_NAME} -lt 1 ]; then echo "Github Secrets not set"; exit 1; fi
- uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ env.nodeVersion }}
- name: Build Auth0 custom lock pages
run: |
npm ci
npm run build
- name: Install AWS CLI
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.DEVELOPMENT_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.DEVELOPMENT_AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Sync files to S3
run: aws s3 cp --recursive dist s3://$AWS_CDN_BUCKET_NAME/nlx/$GITHUB_SHA
- name: Running sanity checks prior to pushing to Auth0
run: ci/scripts/sanity-checks.sh
- name: Deploy login page to Auth0
run: npm run deploy
46 changes: 46 additions & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: auth0-custom-lock
env:
NODE_ENV: 'production'
nodeVersion: '14.x'
pythonVersion: '3.x'
AUTH0_DOMAIN: 'auth-dev.mozilla.auth0.com'
AUTH0_CLIENT_ID: ${{ secrets.PRODUCTION_AUTH0_CLIENT_ID }}
AUTH0_CLIENT_SECRET: ${{ secrets.PRODUCTION_AUTH0_CLIENT_SECRET }}
AWS_CDN_BUCKET_NAME: ${{ secrets.PRODUCTION_AWS_CDN_BUCKET_NAME }}

on:
push:
branches:
- refs/tags/*-prod

jobs:
prod-build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Check for secrets to be set
run: if [ ${#AWS_CDN_BUCKET_NAME} -lt 1 ]; then echo "Github Secrets not set"; exit 1; fi
- uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ env.nodeVersion }}
- name: Build Auth0 custom lock pages
run: |
NODE_ENV=development npm ci
npm run build
- name: Install AWS CLI
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.PRODUCTION_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.PRODUCTION_AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Sync files to S3
run: aws s3 cp --recursive dist s3://$AWS_CDN_BUCKET_NAME/nlx/$GITHUB_SHA
- name: Running sanity checks prior to pushing to Auth0
run: ci/scripts/sanity-checks.sh
- name: Deploy login page to Auth0
run: npm run deploy
28 changes: 28 additions & 0 deletions .github/workflows/pull-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: auth0-custom-lock
env:
NODE_ENV: 'development'
nodeVersion: '14.x'

on:
pull_request:
branches:
- master
push:
branches:
- master

jobs:
dev-build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ env.nodeVersion }}
- run: npm ci
- run: npm run build
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# ignore secrets, as used by `act`
/config/secrets*

/dist
/node_modules
/src/js/config/local-config.json
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

38 changes: 0 additions & 38 deletions Dockerfile

This file was deleted.

100 changes: 0 additions & 100 deletions Makefile

This file was deleted.

Loading

0 comments on commit 15a85f1

Please sign in to comment.