Skip to content

Commit

Permalink
[PWN-3411] chore: webpack and CI integration [No QA]
Browse files Browse the repository at this point in the history
  • Loading branch information
turisap authored Jun 3, 2022
1 parent 14b5937 commit 99bc477
Show file tree
Hide file tree
Showing 22 changed files with 150,259 additions and 16,564 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/deploy-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ jobs:

- name: Build site
env:
# @FIXME in https://p2pvalidator.atlassian.net/browse/PWN-3411
CI: false
PUBLIC_URL: ${{ secrets.PUBLIC_URL }}
REACT_APP_BASENAME: ${{ secrets.REACT_APP_BASENAME }}
REACT_APP_CRYPTO_COMPARE_API_KEY: ${{ secrets.REACT_APP_CRYPTO_COMPARE_API_KEY }}
Expand All @@ -45,3 +43,4 @@ jobs:
branch: gh-pages # The branch the action should deploy to.
folder: ./packages/web/build
clean-exclude: pr-preview/
force: false
104 changes: 103 additions & 1 deletion .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,97 @@ on:
concurrency: preview-${{ github.ref }}

jobs:
set_info:
if: github.event.action == 'opened'
runs-on: ubuntu-latest
environment: staging
name: Set Jira Info
steps:
- uses: actions/checkout@v2

- uses: tzkhan/pr-update-action@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
base-branch-regex: '[a-z\d-_.\\/]+'
head-branch-regex: 'pwn-\d+'
title-update-action: 'prefix'
title-template: '[%headbranch%]'
body-template: |
🚀 [ JIRA TICKET ](https://p2pvalidator.atlassian.net/browse/%headbranch%)
body-update-action: 'prefix'
body-uppercase-base-match: false

lint_types:
runs-on: ubuntu-latest
environment: staging
name: Typecheck TS
steps:
- uses: actions/checkout@v2

- name: Cache node_modules
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}

- name: Install dependecies
run: yarn install --frozen-lockfile

- name: Run Test
run: lerna run --concurrency 1 --stream lint:type --exclude-dependents

lint_es:
needs: lint_types
runs-on: ubuntu-latest
environment: staging
name: Lint ESLint
steps:
- uses: actions/checkout@v2

- name: Cache node_modules
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}

- name: Install dependecies
run: yarn install --frozen-lockfile

- name: Run Test
run: lerna run --concurrency 1 --stream lint:es --exclude-dependents

lint_style:
needs: lint_es
runs-on: ubuntu-latest
environment: staging
name: Lint Stylelint
steps:
- uses: actions/checkout@v2

- name: Cache node_modules
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}

- name: Install dependecies
run: yarn install --frozen-lockfile

- name: Run Test
run: lerna run --concurrency 1 --stream lint:style --exclude-dependents

deploy_stage:
needs: lint_style
if: github.event.action == 'opened' || github.event.action == 'synchronize'
runs-on: ubuntu-latest
environment: staging
name: Deploy PR preview
steps:
- uses: actions/checkout@v2

Expand All @@ -29,7 +117,6 @@ jobs:

- name: Build site
env:
CI: false
PUBLIC_URL: https://p2p-org.github.io/p2p-wallet-web/pr-preview/pr-${{ github.event.pull_request.number }}/
REACT_APP_BASENAME: p2p-wallet-web/pr-preview/pr-${{ github.event.pull_request.number }}/
REACT_APP_CRYPTO_COMPARE_API_KEY: ${{ secrets.REACT_APP_CRYPTO_COMPARE_API_KEY }}
Expand All @@ -49,3 +136,18 @@ jobs:
source-dir: ./packages/web/build
action: deploy
preview-branch: gh-pages

remove_preview:
if: github.event.action == 'closed' || github.event.pull_request.merged
runs-on: ubuntu-latest
environment: staging
name: Remove PR preview
steps:
- uses: actions/checkout@v2

- name: Clean up preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./packages/web/build
action: remove
preview-branch: gh-pages
42 changes: 0 additions & 42 deletions .github/workflows/test-pr.yml

This file was deleted.

Loading

0 comments on commit 99bc477

Please sign in to comment.