From bde1f6cd71400e7f3a0784c88196ebf87843784c Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 10:22:08 +0000 Subject: [PATCH 01/33] HT-17 Run code coverage on pull requests --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 30bfc55..f574ee9 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -47,11 +47,11 @@ jobs: cd ui npm test - name: Code Coverage - if: github.event_name == 'pull_request' uses: romeovs/lcov-reporter-action@v0.2.16 with: lcov-file: ./server/coverage/lcov.info github-token: ${{ secrets.GITHUB_TOKEN }} + if: github.event_name == 'pull_request' - name: Deploy uses: JamesIves/github-pages-deploy-action@v4.2.3 with: From 78571418841aac75bb5ce5e8e31f98d4b133d47a Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 10:29:57 +0000 Subject: [PATCH 02/33] HT-17 Update coverage version --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index f574ee9..d1c1b3c 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -47,7 +47,7 @@ jobs: cd ui npm test - name: Code Coverage - uses: romeovs/lcov-reporter-action@v0.2.16 + uses: romeovs/lcov-reporter-action@v0.3.1 with: lcov-file: ./server/coverage/lcov.info github-token: ${{ secrets.GITHUB_TOKEN }} From a4091b8743d14cd40e702ed3fab7be409d695bd6 Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 10:35:16 +0000 Subject: [PATCH 03/33] HT-17 seperate jobs --- .github/workflows/node.js.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index d1c1b3c..c9b9314 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -8,7 +8,6 @@ on: jobs: build: - runs-on: ubuntu-latest strategy: @@ -38,6 +37,8 @@ jobs: cd ui npm ci npm run build --if-present + test: + runs-on: ubuntu-latest - name: Server - run tests run: | cd server @@ -46,12 +47,17 @@ jobs: run: | cd ui npm test + coverage: + runs-on: ubuntu-latest - name: Code Coverage + if: >- + github.event_name == 'pull_request' uses: romeovs/lcov-reporter-action@v0.3.1 with: lcov-file: ./server/coverage/lcov.info github-token: ${{ secrets.GITHUB_TOKEN }} - if: github.event_name == 'pull_request' + deploy: + runs-on: ubuntu-latest - name: Deploy uses: JamesIves/github-pages-deploy-action@v4.2.3 with: From a5841d2c06eaad2918317c1e37f77b91e21344bf Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 10:37:43 +0000 Subject: [PATCH 04/33] HT-17 Add step definition --- .github/workflows/node.js.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index c9b9314..96979f1 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -39,6 +39,8 @@ jobs: npm run build --if-present test: runs-on: ubuntu-latest + + steps: - name: Server - run tests run: | cd server @@ -49,6 +51,8 @@ jobs: npm test coverage: runs-on: ubuntu-latest + + steps: - name: Code Coverage if: >- github.event_name == 'pull_request' @@ -58,6 +62,8 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} deploy: runs-on: ubuntu-latest + + steps: - name: Deploy uses: JamesIves/github-pages-deploy-action@v4.2.3 with: From c3c15855aa7714bc781a326bd8d04ebf4beb3d1b Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 10:40:18 +0000 Subject: [PATCH 05/33] HT-17 Add needs --- .github/workflows/node.js.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 96979f1..d45e9c2 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -39,6 +39,7 @@ jobs: npm run build --if-present test: runs-on: ubuntu-latest + needs: [build] steps: - name: Server - run tests @@ -51,6 +52,7 @@ jobs: npm test coverage: runs-on: ubuntu-latest + needs: [test] steps: - name: Code Coverage @@ -62,6 +64,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} deploy: runs-on: ubuntu-latest + needs: [coverage] steps: - name: Deploy From f34ebdf60f225661cd122ccad663f3aaac1f8524 Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 10:54:09 +0000 Subject: [PATCH 06/33] HT-17 add artifcats to share data between jobs --- .github/workflows/node.js.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index d45e9c2..e6f3d3c 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -4,7 +4,7 @@ name: Build-Test-Deploy Pipeline on: - push + [push, pull_request] jobs: build: @@ -21,35 +21,50 @@ jobs: uses: supercharge/mongodb-github-action@1.2.0 with: mongodb-version: ${{ matrix.mongodb-version }} + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} cache: 'npm' cache-dependency-path: server/package-lock.json + - name: Server - run build run: | cd server npm ci npm run build --if-present + - name: UI - run build run: | cd ui npm ci npm run build --if-present + + - uses: actions/upload-artifact@master + with: + name: build + path: node/build + test: runs-on: ubuntu-latest needs: [build] steps: + - uses: actions/download-artifact@master + with: + name: build + path: node/build - name: Server - run tests run: | cd server npm test + - name: UI - run tests run: | cd ui npm test + coverage: runs-on: ubuntu-latest needs: [test] @@ -62,6 +77,7 @@ jobs: with: lcov-file: ./server/coverage/lcov.info github-token: ${{ secrets.GITHUB_TOKEN }} + deploy: runs-on: ubuntu-latest needs: [coverage] From f7bed8363a3536ba154a793beeed8df0b81afbb7 Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 10:58:41 +0000 Subject: [PATCH 07/33] HT-17 add all to artifact --- .github/workflows/node.js.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index e6f3d3c..0dbd02d 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -44,7 +44,7 @@ jobs: - uses: actions/upload-artifact@master with: name: build - path: node/build + path: . test: runs-on: ubuntu-latest @@ -54,7 +54,7 @@ jobs: - uses: actions/download-artifact@master with: name: build - path: node/build + path: . - name: Server - run tests run: | cd server From 7aec5d25cbfff826de822d9aecf31619e0779be0 Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 11:02:21 +0000 Subject: [PATCH 08/33] HT-17 narrow down files for artifact --- .github/workflows/node.js.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 0dbd02d..d819f6f 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -44,7 +44,9 @@ jobs: - uses: actions/upload-artifact@master with: name: build - path: . + path: | + ui/dist + server test: runs-on: ubuntu-latest @@ -54,7 +56,9 @@ jobs: - uses: actions/download-artifact@master with: name: build - path: . + path: | + ui/dist + server - name: Server - run tests run: | cd server From 76ed98d13788ecd84cba869afae36e6ba706ca69 Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 11:04:21 +0000 Subject: [PATCH 09/33] HT-17 Use artifact for ui --- .github/workflows/node.js.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index d819f6f..1cc0bbc 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -46,7 +46,6 @@ jobs: name: build path: | ui/dist - server test: runs-on: ubuntu-latest @@ -58,17 +57,17 @@ jobs: name: build path: | ui/dist - server - - name: Server - run tests - run: | - cd server - npm test - name: UI - run tests run: | cd ui npm test + - name: Server - run tests + run: | + cd server + npm test + coverage: runs-on: ubuntu-latest needs: [test] From e2329ad0002858b183ba7d45ec459d0ad8e6fe08 Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 11:07:19 +0000 Subject: [PATCH 10/33] HT-17 Use artifact for ui #2 --- .github/workflows/node.js.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 1cc0bbc..769f19b 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -46,6 +46,9 @@ jobs: name: build path: | ui/dist + ui/package.json + ui/package-lock.json + ui/src/test test: runs-on: ubuntu-latest @@ -57,6 +60,9 @@ jobs: name: build path: | ui/dist + ui/package.json + ui/package-lock.json + ui/src/test - name: UI - run tests run: | From 9af3264e84b70f9ede20b0f9361b3f275e60cecf Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 11:12:16 +0000 Subject: [PATCH 11/33] HT-17 try and remove node_modules from artifact --- .github/workflows/node.js.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 769f19b..edd495f 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -45,10 +45,8 @@ jobs: with: name: build path: | - ui/dist - ui/package.json - ui/package-lock.json - ui/src/test + . + !node_modules test: runs-on: ubuntu-latest @@ -58,11 +56,6 @@ jobs: - uses: actions/download-artifact@master with: name: build - path: | - ui/dist - ui/package.json - ui/package-lock.json - ui/src/test - name: UI - run tests run: | From 4f323218a1e98ecb92030b6592f9a0cab0f58631 Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 11:14:57 +0000 Subject: [PATCH 12/33] HT-17 try and remove node_modules from artifact #2 --- .github/workflows/node.js.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index edd495f..eb34943 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -45,8 +45,8 @@ jobs: with: name: build path: | - . - !node_modules + ui + !ui/node_modules test: runs-on: ubuntu-latest From 84d810fd1777fcc98c86f5d27d0d249e3f636e7e Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 11:18:19 +0000 Subject: [PATCH 13/33] HT-17 try and remove node_modules from artifact #3 --- .github/workflows/node.js.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index eb34943..30e9295 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -37,7 +37,6 @@ jobs: - name: UI - run build run: | - cd ui npm ci npm run build --if-present From 414bf18d40e9781690a22d58c39c3a2a1c7365c4 Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 11:19:47 +0000 Subject: [PATCH 14/33] HT-17 try and remove node_modules from artifact #4 --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 30e9295..ed60d1f 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -37,6 +37,7 @@ jobs: - name: UI - run build run: | + cd ui npm ci npm run build --if-present @@ -58,7 +59,6 @@ jobs: - name: UI - run tests run: | - cd ui npm test - name: Server - run tests From dc5d0307c7042fe98199cbb76a17694e8322341d Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 11:23:19 +0000 Subject: [PATCH 15/33] HT-17 try and remove node_modules from artifact #5 --- .github/workflows/node.js.yml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index ed60d1f..72ecf66 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -43,27 +43,38 @@ jobs: - uses: actions/upload-artifact@master with: - name: build + name: build-ui path: | ui !ui/node_modules + name: build-server + path: | + server + !server/node_modules - test: + test-ui: runs-on: ubuntu-latest needs: [build] steps: - uses: actions/download-artifact@master with: - name: build + name: build-ui - name: UI - run tests run: | npm test - - name: Server - run tests + test-server: + runs-on: ubuntu-latest + needs: [build] + + steps: + - uses: actions/download-artifact@master + with: + name: build-server + - name: Server - run tests run: | - cd server npm test coverage: From 5aa00c2e969ad7695d8e48bb28021cf0e6846f39 Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 11:24:33 +0000 Subject: [PATCH 16/33] HT-17 try and remove node_modules from artifact #6 --- .github/workflows/node.js.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 72ecf66..146f4dd 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -47,6 +47,9 @@ jobs: path: | ui !ui/node_modules + + - uses: actions/upload-artifact@master + with: name: build-server path: | server From ca02e52af983756dcf07c24bd8c1bf3b2510b668 Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 11:26:23 +0000 Subject: [PATCH 17/33] HT-17 fix workflow file --- .github/workflows/node.js.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 146f4dd..3310d73 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -82,7 +82,7 @@ jobs: coverage: runs-on: ubuntu-latest - needs: [test] + needs: [test-server,test-ui] steps: - name: Code Coverage @@ -95,7 +95,7 @@ jobs: deploy: runs-on: ubuntu-latest - needs: [coverage] + needs: [test-server,test-ui] steps: - name: Deploy From b82a02dc33130acd805895def1c59bb8756d9c18 Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 11:30:05 +0000 Subject: [PATCH 18/33] HT-17 add mongo to server test --- .github/workflows/node.js.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 3310d73..0713215 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -13,14 +13,9 @@ jobs: strategy: matrix: node-version: [16.x] - mongodb-version: [4.2] steps: - uses: actions/checkout@v2 - - name: Start MongoDB v${{ matrix.mongodb-version }} - uses: supercharge/mongodb-github-action@1.2.0 - with: - mongodb-version: ${{ matrix.mongodb-version }} - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v2 @@ -72,7 +67,16 @@ jobs: runs-on: ubuntu-latest needs: [build] + strategy: + matrix: + mongodb-version: [4.2] + steps: + - name: Start MongoDB v${{ matrix.mongodb-version }} + uses: supercharge/mongodb-github-action@1.2.0 + with: + mongodb-version: ${{ matrix.mongodb-version }} + - uses: actions/download-artifact@master with: name: build-server From 0fd3cb1f6a309b11d45ffb567988eb4a9671b9d3 Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 11:33:49 +0000 Subject: [PATCH 19/33] HT-17 install modules before testing --- .github/workflows/node.js.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 0713215..21e8925 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -61,6 +61,7 @@ jobs: - name: UI - run tests run: | + npp i npm test test-server: @@ -82,6 +83,7 @@ jobs: name: build-server - name: Server - run tests run: | + npm i npm test coverage: From 6a384b32d73b6762a14f89fcebc5509e5edb605a Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 11:36:23 +0000 Subject: [PATCH 20/33] HT-17 Fix spelling mistake --- .github/workflows/node.js.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 21e8925..c132554 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -13,6 +13,7 @@ jobs: strategy: matrix: node-version: [16.x] + mongodb-version: [4.2] steps: - uses: actions/checkout@v2 @@ -23,6 +24,10 @@ jobs: node-version: ${{ matrix.node-version }} cache: 'npm' cache-dependency-path: server/package-lock.json + - name: Start MongoDB v${{ matrix.mongodb-version }} + uses: supercharge/mongodb-github-action@1.2.0 + with: + mongodb-version: ${{ matrix.mongodb-version }} - name: Server - run build run: | @@ -61,23 +66,14 @@ jobs: - name: UI - run tests run: | - npp i + npm i npm test test-server: runs-on: ubuntu-latest needs: [build] - strategy: - matrix: - mongodb-version: [4.2] - steps: - - name: Start MongoDB v${{ matrix.mongodb-version }} - uses: supercharge/mongodb-github-action@1.2.0 - with: - mongodb-version: ${{ matrix.mongodb-version }} - - uses: actions/download-artifact@master with: name: build-server From 3c860eeb6c11308e2e6510357b85753b3c68f43f Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 11:39:24 +0000 Subject: [PATCH 21/33] HT-17 readd mongo to server test --- .github/workflows/node.js.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index c132554..13a4f62 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -13,7 +13,6 @@ jobs: strategy: matrix: node-version: [16.x] - mongodb-version: [4.2] steps: - uses: actions/checkout@v2 @@ -24,10 +23,6 @@ jobs: node-version: ${{ matrix.node-version }} cache: 'npm' cache-dependency-path: server/package-lock.json - - name: Start MongoDB v${{ matrix.mongodb-version }} - uses: supercharge/mongodb-github-action@1.2.0 - with: - mongodb-version: ${{ matrix.mongodb-version }} - name: Server - run build run: | @@ -73,7 +68,16 @@ jobs: runs-on: ubuntu-latest needs: [build] + strategy: + matrix: + mongodb-version: [4.2] + steps: + - name: Start MongoDB v${{ matrix.mongodb-version }} + uses: supercharge/mongodb-github-action@1.2.0 + with: + mongodb-version: ${{ matrix.mongodb-version }} + - uses: actions/download-artifact@master with: name: build-server From 66464f3b775a16de663e9f3e679a9d4481016872 Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 11:46:50 +0000 Subject: [PATCH 22/33] HT-17 add coverage artifacts --- .github/workflows/node.js.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 13a4f62..f12a55a 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -81,16 +81,27 @@ jobs: - uses: actions/download-artifact@master with: name: build-server + - name: Server - run tests run: | npm i npm test + - uses: actions/upload-artifact@master + with: + name: coverage-server + path: | + coverage + coverage: runs-on: ubuntu-latest needs: [test-server,test-ui] steps: + - uses: actions/download-artifact@master + with: + name: coverage-server + - name: Code Coverage if: >- github.event_name == 'pull_request' @@ -104,6 +115,10 @@ jobs: needs: [test-server,test-ui] steps: + - uses: actions/download-artifact@master + with: + name: build-ui + - name: Deploy uses: JamesIves/github-pages-deploy-action@v4.2.3 with: From 06445e63de2fc019539a6f4ac543172577fc49b0 Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 11:51:10 +0000 Subject: [PATCH 23/33] HT-17 fix file paths --- .github/workflows/node.js.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index f12a55a..119e3c9 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -107,7 +107,7 @@ jobs: github.event_name == 'pull_request' uses: romeovs/lcov-reporter-action@v0.3.1 with: - lcov-file: ./server/coverage/lcov.info + lcov-file: lcov.info github-token: ${{ secrets.GITHUB_TOKEN }} deploy: @@ -123,4 +123,4 @@ jobs: uses: JamesIves/github-pages-deploy-action@v4.2.3 with: branch: gh-pages - folder: ./ui/dist/ + folder: dist From bfc5b41307663ff303eb8ce8b091cbe26d64feac Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 12:00:05 +0000 Subject: [PATCH 24/33] HT-17 checkout in deploy --- .github/workflows/node.js.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 119e3c9..4a6fb94 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -4,7 +4,9 @@ name: Build-Test-Deploy Pipeline on: - [push, pull_request] + push: + pull_request: + branches: [ develop ] jobs: build: @@ -119,6 +121,8 @@ jobs: with: name: build-ui + - uses: actions/checkout@v2 + - name: Deploy uses: JamesIves/github-pages-deploy-action@v4.2.3 with: From 06810a1eb124857f8fd5c1b2d1035bb390231610 Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 12:03:56 +0000 Subject: [PATCH 25/33] HT-17 move checkout before artifact pull --- .github/workflows/node.js.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 4a6fb94..ab98617 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -117,12 +117,12 @@ jobs: needs: [test-server,test-ui] steps: + - uses: actions/checkout@v2 + - uses: actions/download-artifact@master with: name: build-ui - - uses: actions/checkout@v2 - - name: Deploy uses: JamesIves/github-pages-deploy-action@v4.2.3 with: From a8f8ade80fe9ff9823c6a7d9f3e2ba3ee8f44a87 Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 12:13:58 +0000 Subject: [PATCH 26/33] HT-17 attempt to stop 2 builds from running --- .github/workflows/node.js.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index ab98617..6c72895 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -4,9 +4,11 @@ name: Build-Test-Deploy Pipeline on: + workflow_dispatch: + push: - pull_request: - branches: [ develop ] + paths-ignore: + - 'README.md' jobs: build: @@ -124,6 +126,8 @@ jobs: name: build-ui - name: Deploy + if: >- + github.event_name == 'pull_request' uses: JamesIves/github-pages-deploy-action@v4.2.3 with: branch: gh-pages From 0160dd75de205366c85fe14b4ecfd3e6927c7987 Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 12:24:07 +0000 Subject: [PATCH 27/33] HT-17 readd both runs --- .github/workflows/node.js.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 6c72895..e415024 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -5,10 +5,8 @@ name: Build-Test-Deploy Pipeline on: workflow_dispatch: - + pull_request: push: - paths-ignore: - - 'README.md' jobs: build: From 07172f7f35355ded23e267aabbc84c166340671f Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 12:28:06 +0000 Subject: [PATCH 28/33] HT-17 move if outside steps --- .github/workflows/node.js.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index e415024..c2d600e 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -99,14 +99,14 @@ jobs: runs-on: ubuntu-latest needs: [test-server,test-ui] + if: >- + github.event_name == 'pull_request' steps: - uses: actions/download-artifact@master with: name: coverage-server - name: Code Coverage - if: >- - github.event_name == 'pull_request' uses: romeovs/lcov-reporter-action@v0.3.1 with: lcov-file: lcov.info @@ -116,6 +116,8 @@ jobs: runs-on: ubuntu-latest needs: [test-server,test-ui] + if: >- + github.event_name == 'pull_request' steps: - uses: actions/checkout@v2 @@ -124,8 +126,6 @@ jobs: name: build-ui - name: Deploy - if: >- - github.event_name == 'pull_request' uses: JamesIves/github-pages-deploy-action@v4.2.3 with: branch: gh-pages From 595d34853b755564799e46a09e9c7be57fcc054a Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 12:59:24 +0000 Subject: [PATCH 29/33] HT-17 add release workflow --- .github/workflows/docker-publish.yml | 45 ++++++++++++++++++++++++++++ .github/workflows/node.js.yml | 2 +- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/docker-publish.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..f7bdce0 --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,45 @@ +name: Publish Docker image + +on: + release: + types: [published] + +jobs: + push_to_registries: + name: Push Docker image + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - name: Check out the repo + uses: actions/checkout@v2 + + - name: Log in to Docker Hub + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Log in to the Container registry + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: | + jarrodback/highway-tracker + ghcr.io/${{ github.repository }} + + - name: Build and push Docker images + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index c2d600e..bcb5927 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -125,7 +125,7 @@ jobs: with: name: build-ui - - name: Deploy + - name: Deploy to GitHub Pages uses: JamesIves/github-pages-deploy-action@v4.2.3 with: branch: gh-pages From 3f877ef4bcddd0cd51ec147e106830e5c31674c8 Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 13:03:01 +0000 Subject: [PATCH 30/33] HT-17 fix indents on publish workflow --- .github/workflows/docker-publish.yml | 66 ++++++++++++++-------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index f7bdce0..b07ad2f 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -6,40 +6,40 @@ on: jobs: push_to_registries: - name: Push Docker image - runs-on: ubuntu-latest - permissions: - packages: write - contents: read - steps: - - name: Check out the repo - uses: actions/checkout@v2 + name: Push Docker image + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - name: Check out the repo + uses: actions/checkout@v2 - - name: Log in to Docker Hub - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + - name: Log in to Docker Hub + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} - - name: Log in to the Container registry - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + - name: Log in to the Container registry + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 - with: - images: | - jarrodback/highway-tracker - ghcr.io/${{ github.repository }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: | + jarrodback/highway-tracker + ghcr.io/${{ github.repository }} - - name: Build and push Docker images - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + - name: Build and push Docker images + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file From 6441fafe4e5d43ee09d8e3c5bf1974d456449e70 Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 13:04:24 +0000 Subject: [PATCH 31/33] HT-17 fix indents on publish workflow #2 --- .github/workflows/docker-publish.yml | 58 ++++++++++++++-------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index b07ad2f..b214c8f 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -11,35 +11,35 @@ jobs: permissions: packages: write contents: read - steps: - - name: Check out the repo - uses: actions/checkout@v2 + steps: + - name: Check out the repo + uses: actions/checkout@v2 - - name: Log in to Docker Hub - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + - name: Log in to Docker Hub + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} - - name: Log in to the Container registry - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + - name: Log in to the Container registry + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 - with: - images: | - jarrodback/highway-tracker - ghcr.io/${{ github.repository }} - - - name: Build and push Docker images - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: | + jarrodback/highway-tracker + ghcr.io/${{ github.repository }} + + - name: Build and push Docker images + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} From 10ac1eb610c82c7d78af451c0c28932d6719b983 Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 13:10:44 +0000 Subject: [PATCH 32/33] HT-17 add correct file path for dockerfile --- .github/workflows/docker-publish.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index b214c8f..f5e5e7b 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -39,7 +39,9 @@ jobs: - name: Build and push Docker images uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc with: - context: . + context: | + server/ + ui/ push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} From 6e3f6b23951fe61a3b6c20c4413a93bf3ef5b699 Mon Sep 17 00:00:00 2001 From: jarrodback Date: Thu, 3 Feb 2022 13:20:23 +0000 Subject: [PATCH 33/33] HT-17 add correct file path for dockerfile #2 --- .github/workflows/docker-publish.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index f5e5e7b..4c53acc 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -39,9 +39,7 @@ jobs: - name: Build and push Docker images uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc with: - context: | - server/ - ui/ + context: ./server/ push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}