ci(nodejs): update techradar and switch to npm

This commit is contained in:
Bastian Ike
2022-05-20 11:05:40 +02:00
committed by Bastian
parent 39c9f9c4d9
commit c5a046b6bc
5 changed files with 27306 additions and 12165 deletions

View File

@@ -1,29 +1,71 @@
name: Deploy Technology Radar name: Build Technology Radar
on: on:
pull_request:
push: push:
branches: branches:
- main - main
jobs: jobs:
deploy: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@master - uses: actions/checkout@master
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: '16' node-version: "lts/*"
- run: yarn cache clean --force - run: npm ci
- run: rm -rf node_modules/ - run: PUBLIC_URL=/techradar npm run build:static
- run: yarn --frozen-lockfile --network-timeout 100000 --network-concurrency 1 - run: if [ -n "$(git status --porcelain)" ]; then echo 'workspace is dirty after rebuilding' ; git status ; git diff ; exit 1 ; fi
- run: PUBLIC_URL=/techradar yarn build:static - name: Upload Artifact
- uses: jakejarvis/s3-sync-action@master uses: actions/upload-artifact@v3
with: with:
args: --acl public-read name: build
env: path: build
AWS_S3_BUCKET: 'techradar.aoe.com' deploy:
AWS_ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY }} runs-on: ubuntu-20.04
AWS_SECRET_ACCESS_KEY: ${{ secrets.ACCESS_SECRET }} if: github.ref == 'refs/heads/main'
AWS_REGION: 'eu-central-1' needs: build
SOURCE_DIR: 'build' environment:
DEST_DIR: 'techradar' name: techradar
url: https://www.aoe.com/techradar/index.html
steps:
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: build
path: build
- uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read
env:
AWS_S3_BUCKET: "techradar.aoe.com"
AWS_ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.ACCESS_SECRET }}
AWS_REGION: "eu-central-1"
SOURCE_DIR: "build"
DEST_DIR: "techradar"
deploy-dev:
runs-on: ubuntu-20.04
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
needs: build
environment:
name: techradar-next
url: http://techradar-next.aoe.com.s3.eu-central-1.amazonaws.com/techradar/index.html
steps:
- run: echo "WARNING! THIS DEPLOYS A STAGING ENV, RERUN THIS JOB TO GET YOUR CHANGES DEPLOYED TO STAGING"
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: build
path: build
- uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read
env:
AWS_S3_BUCKET: "techradar-next.aoe.com"
AWS_ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.ACCESS_SECRET }}
AWS_REGION: "eu-central-1"
SOURCE_DIR: "build"
DEST_DIR: "techradar"

View File

@@ -5,8 +5,6 @@ This is the location of AOE techradar content - published under: https://www.aoe
If you want to build your own techradar you may want to have a look at https://github.com/AOEpeople/aoe_technology_radar instead. If you want to build your own techradar you may want to have a look at https://github.com/AOEpeople/aoe_technology_radar instead.
## Development ## Development
### Requirements
Install the [yarn package manager](https://yarnpkg.com/getting-started/install).
### Host the application under a sub path ### Host the application under a sub path
To host the application under a sub path, set the environment variable `PUBLIC_URL`, e.g. "/techradar". To host the application under a sub path, set the environment variable `PUBLIC_URL`, e.g. "/techradar".
@@ -16,23 +14,23 @@ The default is `/build`.
### Build the radar ### Build the radar
``` ```
yarn npm i
yarn start npm run start
``` ```
Then open here: http://localhost:8080/build Then open here: http://localhost:8080/build
### Build the radar with static files ### Build the radar with static files
``` ```
yarn npm i
yarn start:static npm run start:static
``` ```
Then open here: http://localhost:8080/build Then open here: http://localhost:8080/build
### Regenerate the json file based on your changes on md files ### Regenerate the json file based on your changes on md files
``` ```
yarn generateJson npm run generateJson
``` ```
You can do this while the server is running. You can do this while the server is running.

27228
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -4,19 +4,19 @@
"main": "index.js", "main": "index.js",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"build": "aoe_technology_radar-buildRadar", "build": "npx aoe_technology_radar-buildRadar",
"postbuild": "yarn generateJson", "postbuild": "npm run generateJson",
"prebuild:static": "yarn build", "prebuild:static": "npm run build",
"build:static": "aoe_technology_radar-createStaticFiles", "build:static": "npx aoe_technology_radar-createStaticFiles",
"generateJson": "aoe_technology_radar-generateJson", "generateJson": "npx aoe_technology_radar-generateJson",
"prestart": "yarn build:static", "prestart": "npm run build:static",
"start": "yarn start:server", "start": "npm run start:server",
"prestart:static": "yarn build:static", "prestart:static": "npm run build:static",
"start:static": "yarn start:server", "start:static": "npm run start:server",
"start:server": "python3 -m http.server 8080" "start:server": "python3 -m http.server 8080"
}, },
"dependencies": { "dependencies": {
"aoe_technology_radar": "^3.2.0" "aoe_technology_radar": "3.3.0"
}, },
"browserslist": { "browserslist": {
"production": [ "production": [

12127
yarn.lock

File diff suppressed because it is too large Load Diff