Skip to content
This repository has been archived by the owner on Apr 7, 2021. It is now read-only.

Commit

Permalink
👷‍♂️ Engineering systems update (#121)
Browse files Browse the repository at this point in the history
* init lerna + yarn

* add dependabot for yarn and docker

* add pre-commit prettier  hook

* docker + actions update

* add codecov script to package

* update docker actions build

* move dockerfile to root

* use buildx for docker builds

* buildx fix

* buildx fix

* revert buildx, add yarn.lock to git

* add project target to docker build action

* separate dockerfiles

* ci docker fix
  • Loading branch information
bmiddha authored Aug 3, 2020
1 parent 36b6347 commit 452bd97
Show file tree
Hide file tree
Showing 36 changed files with 14,921 additions and 14,294 deletions.
11 changes: 11 additions & 0 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 1
update_configs:
# Keep package.json (& lockfiles) up to date as soon as
# new versions are published to the npm registry
- package_manager: 'javascript'
directory: '/'
update_schedule: 'live'
# Keep Dockerfile up to date, batching pull requests weekly
- package_manager: 'docker'
directory: '/docker'
update_schedule: 'weekly'
14 changes: 5 additions & 9 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
.github
.vscode
common/temp
k8s
design-assets
.vscode
build-images.ps1
docker-compose*.yml
*Dockerfile
*.md
*/node_modules
*/dist
*/build
*/.rush
*/*.build.log
*/*.build.error.log
*/.nyc_output
*/coverage
node_modules
**/**/dist
**/**/build
**/**/.nyc_output
**/**/coverage
84 changes: 84 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: CI

on:
push:
create:
release:
pull_request:
workflow_dispatch:

jobs:
build-test-node:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Restore Package Cache
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install yarn
run: npm i -g yarn
- name: Install dependencies
run: yarn install
- name: Build projects
run: yarn build
- name: Run tests
run: yarn test
- name: Publish coverage
run: yarn coverage

build-push-docker:
runs-on: ubuntu-latest
needs:
- build-test-node
strategy:
fail-fast: false
matrix:
project: [api, banner, banner-data, client]
steps:
- uses: actions/checkout@v2
- name: Pull base images
run: |
docker pull node:12-alpine
docker pull nginx:alpine
- uses: satackey/action-docker-layer-caching@v0.0.4
- name: Build and push Docker images
uses: docker/build-push-action@v1
with:
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
registry: ${{ secrets.REGISTRY_HOST }}
repository: ${{ github.repository }}/${{ matrix.project }}
build_args: CLIENT_WEBPUSHPUBLIC=${{ secrets.WEBPUSHPUBLIC }}
path: .
dockerfile: docker/${{ matrix.project }}.Dockerfile
add_git_labels: true
tag_with_ref: true
push: ${{ (startsWith(github.ref, 'refs/tags/') || (github.ref == 'refs/heads/master') || (github.ref == 'refs/heads/staging')) }}

trigger-hooks:
runs-on: ubuntu-latest
needs:
- build-push-docker
steps:
- name: Trigger Hooks - master
if: github.ref == 'refs/heads/master'
run: |
curl -X POST -H "Content-Type: application/json" -d "{}" '${{ secrets.MASTER_HOOK }}'
- name: Trigger Hooks - staging
if: github.ref == 'refs/heads/staging'
run: |
curl -X POST -H "Content-Type: application/json" -d "{}" '${{ secrets.STAGING_HOOK }}'
- name: Trigger Hooks - release
if: startsWith(github.ref, 'refs/tags/')
run: |
curl -X POST -H "Content-Type: application/json" -d "{}" '${{ secrets.PROD_HOOK }}'
53 changes: 0 additions & 53 deletions .github/workflows/docker-cd-branch.yml

This file was deleted.

45 changes: 0 additions & 45 deletions .github/workflows/docker-cd-release.yml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/workflows/docker.yml

This file was deleted.

44 changes: 0 additions & 44 deletions .github/workflows/nodejs.yml

This file was deleted.

6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,9 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

# npm and yarn lock files
package-lock.json
yarn.lock

# Rush temporary files
common/temp/
**/.rush/temp/

# K8s Secrets.yaml
Secrets.yaml
Secrets.yaml
9 changes: 4 additions & 5 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
pnpm-lock.yaml
common
yarn.lock

#-------------------------------------------------------------------------------------------------------------------
# Keep this section in sync with .gitignore
Expand Down Expand Up @@ -195,9 +194,9 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

# npm and yarn lock files
package-lock.json
yarn.lock
# Rush temporary files
common/temp/
**/.rush/temp/

# K8s Secrets.yaml
Secrets.yaml
13 changes: 1 addition & 12 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"aaron-bond.better-comments",
"coenraads.bracket-pair-colorizer-2",
"streetsidesoftware.code-spell-checker",
"ms-azuretools.vscode-docker",
"eamodio.gitlens",
"yzhang.markdown-all-in-one",
"davidanson.vscode-markdownlint",
"visualstudioexptteam.vscodeintellicode",
"redhat.vscode-yaml"
]
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
}
15 changes: 0 additions & 15 deletions .vscode/launch.json

This file was deleted.

Loading

0 comments on commit 452bd97

Please sign in to comment.