From f750521a6ac638b981886b499d261337a751cb31 Mon Sep 17 00:00:00 2001 From: Ben Liu Date: Sat, 22 Jul 2023 16:48:50 +0700 Subject: [PATCH 1/2] feat(workflow): add homepage CI pipeline --- .github/workflows/build-homepage.yml | 46 ++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/build-homepage.yml diff --git a/.github/workflows/build-homepage.yml b/.github/workflows/build-homepage.yml new file mode 100644 index 00000000..4f14271c --- /dev/null +++ b/.github/workflows/build-homepage.yml @@ -0,0 +1,46 @@ +# This workflow will do a clean install of node dependencies, cache/restore them, 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: homepage CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +defaults: + run: + shell: bash + working-directory: homepage + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [14.x, 16.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + cache: 'yarn' + cache-dependency-path: ./yarn.lock + - run: yarn install + - run: yarn build + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js 16.x + uses: actions/setup-node@v2 + with: + node-version: 16.x + cache: 'yarn' + cache-dependency-path: ./yarn.lock + - run: yarn install + - run: yarn lint From f1774db1029ef66c0d4d4c00f64ee14a81a94f13 Mon Sep 17 00:00:00 2001 From: Ben Liu Date: Sat, 22 Jul 2023 16:52:58 +0700 Subject: [PATCH 2/2] fix(homepage): admin config linted --- homepage/public/admin/config.yml | 40 +++++++++++++++++--------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/homepage/public/admin/config.yml b/homepage/public/admin/config.yml index 55f6a6d9..c380b3d0 100644 --- a/homepage/public/admin/config.yml +++ b/homepage/public/admin/config.yml @@ -61,11 +61,12 @@ collections: # A list of collections the CMS should be able to edit label: 'Type', name: 'type', widget: 'select', - options: [ - { label: '專案', value: 'project' }, - { label: '人力', value: 'job' }, - { label: '事件', value: 'event' }, - ], + options: + [ + { label: '專案', value: 'project' }, + { label: '人力', value: 'job' }, + { label: '事件', value: 'event' }, + ], i18n: duplicate, } - { @@ -74,20 +75,21 @@ collections: # A list of collections the CMS should be able to edit widget: 'select', required: false, multiple: true, - options: [ - { label: '開放政府', value: 'open gov' }, - { label: '開放資料', value: 'open data' }, - { label: '開放原始碼', value: 'open source' }, - { label: '基礎', value: 'basic' }, - { label: '進階', value: 'advance' }, - { label: '工程師', value: 'engineer' }, - { label: '美術設計', value: 'designer' }, - { label: '文字工作者', value: 'writer' }, - { label: '行銷公關', value: 'marketing' }, - { label: '議題工作者', value: 'advocator' }, - { label: '公務員', value: 'civil servants' }, - { label: '法務人員', value: 'legal' }, - ], + options: + [ + { label: '開放政府', value: 'open gov' }, + { label: '開放資料', value: 'open data' }, + { label: '開放原始碼', value: 'open source' }, + { label: '基礎', value: 'basic' }, + { label: '進階', value: 'advance' }, + { label: '工程師', value: 'engineer' }, + { label: '美術設計', value: 'designer' }, + { label: '文字工作者', value: 'writer' }, + { label: '行銷公關', value: 'marketing' }, + { label: '議題工作者', value: 'advocator' }, + { label: '公務員', value: 'civil servants' }, + { label: '法務人員', value: 'legal' }, + ], i18n: duplicate, } - { label: 'Content', name: 'body', widget: 'markdown', i18n: true }