From 4eeca6120a3100c4b4ccc08533fb567c4c822041 Mon Sep 17 00:00:00 2001 From: yen Date: Wed, 16 Aug 2023 14:55:45 +0800 Subject: [PATCH 01/30] Create node.js.yml --- .github/workflows/node.js.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/node.js.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 0000000..1a8f608 --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,30 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs + +name: Node.js CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [14.x, 16.x, 18.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm run deploy From fb6a174884f327453e652680f83566d8bbeb695a Mon Sep 17 00:00:00 2001 From: lly02 Date: Wed, 16 Aug 2023 15:02:28 +0800 Subject: [PATCH 02/30] test github action --- sudoku-app/src/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sudoku-app/src/App.js b/sudoku-app/src/App.js index 3214891..a5db04f 100644 --- a/sudoku-app/src/App.js +++ b/sudoku-app/src/App.js @@ -62,7 +62,7 @@ function App() { switch (difficulty) { case "easy": - holes = 20; + holes = 5; break; case "medium": From ee16b571516670f8d35a5d4293ba861b17cf4930 Mon Sep 17 00:00:00 2001 From: lly02 Date: Wed, 16 Aug 2023 15:06:16 +0800 Subject: [PATCH 03/30] test github action --- sudoku-app/src/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sudoku-app/src/App.js b/sudoku-app/src/App.js index a5db04f..779e0bf 100644 --- a/sudoku-app/src/App.js +++ b/sudoku-app/src/App.js @@ -62,7 +62,7 @@ function App() { switch (difficulty) { case "easy": - holes = 5; + holes = 2; break; case "medium": From a7b55711a0650c2a4db3e1bab6df1d3f06b2a2d3 Mon Sep 17 00:00:00 2001 From: lly02 Date: Wed, 16 Aug 2023 15:11:31 +0800 Subject: [PATCH 04/30] test github action --- sudoku-app/src/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sudoku-app/src/App.js b/sudoku-app/src/App.js index 779e0bf..72e608f 100644 --- a/sudoku-app/src/App.js +++ b/sudoku-app/src/App.js @@ -62,7 +62,7 @@ function App() { switch (difficulty) { case "easy": - holes = 2; + holes = 1; break; case "medium": From 3bf51e81e6b38349edb0cef55612e37e865738a2 Mon Sep 17 00:00:00 2001 From: lly02 Date: Wed, 16 Aug 2023 15:14:10 +0800 Subject: [PATCH 05/30] test github action --- sudoku-app/src/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sudoku-app/src/App.js b/sudoku-app/src/App.js index 72e608f..779e0bf 100644 --- a/sudoku-app/src/App.js +++ b/sudoku-app/src/App.js @@ -62,7 +62,7 @@ function App() { switch (difficulty) { case "easy": - holes = 1; + holes = 2; break; case "medium": From c644a971196ae67c4a999f068e5e505086d02989 Mon Sep 17 00:00:00 2001 From: yen Date: Wed, 16 Aug 2023 15:16:00 +0800 Subject: [PATCH 06/30] Update node.js.yml --- .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 1a8f608..d3097bc 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -5,9 +5,9 @@ name: Node.js CI on: push: - branches: [ "main" ] + branches: [ "feat-github-action" ] pull_request: - branches: [ "main" ] + branches: [ "feat-github-action" ] jobs: build: From 9b8b2ccdc4d069522d13cdf8bbd131d762b79f3d Mon Sep 17 00:00:00 2001 From: lly02 Date: Wed, 16 Aug 2023 15:16:20 +0800 Subject: [PATCH 07/30] test github action --- sudoku-app/src/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sudoku-app/src/App.js b/sudoku-app/src/App.js index 779e0bf..72e608f 100644 --- a/sudoku-app/src/App.js +++ b/sudoku-app/src/App.js @@ -62,7 +62,7 @@ function App() { switch (difficulty) { case "easy": - holes = 2; + holes = 1; break; case "medium": From 18d8c397c3c98ea8329376b0117cf1dc3fb917ae Mon Sep 17 00:00:00 2001 From: yen Date: Wed, 16 Aug 2023 16:01:48 +0800 Subject: [PATCH 08/30] Update node.js.yml --- .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 d3097bc..6905265 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -13,6 +13,9 @@ jobs: build: runs-on: ubuntu-latest + defaults: + run: + working-directory: ./sudoku-app strategy: matrix: From 5519deaced5a7fb4ed0f9dbd56b9c6387ad5b13f Mon Sep 17 00:00:00 2001 From: lly02 Date: Wed, 16 Aug 2023 16:13:15 +0800 Subject: [PATCH 09/30] test github action --- sudoku-app/src/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sudoku-app/src/App.js b/sudoku-app/src/App.js index 72e608f..779e0bf 100644 --- a/sudoku-app/src/App.js +++ b/sudoku-app/src/App.js @@ -62,7 +62,7 @@ function App() { switch (difficulty) { case "easy": - holes = 1; + holes = 2; break; case "medium": From b8bb5ecf684811a8a39c5536235b961091b791f9 Mon Sep 17 00:00:00 2001 From: yen Date: Wed, 16 Aug 2023 16:18:58 +0800 Subject: [PATCH 10/30] Update node.js.yml --- .github/workflows/node.js.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 6905265..f20ee77 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -19,7 +19,7 @@ jobs: strategy: matrix: - node-version: [14.x, 16.x, 18.x] + node-version: [18.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: @@ -29,5 +29,6 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: 'npm' + cache-dependency-path: sudoku-app/package-lock.json - run: npm ci - run: npm run deploy From 5d39b34a0be02ccb718b30bac49b7bef21a76e36 Mon Sep 17 00:00:00 2001 From: lly02 Date: Wed, 16 Aug 2023 16:26:14 +0800 Subject: [PATCH 11/30] bugfix: added babel package to resolve dependency error --- sudoku-app/package-lock.json | 25 ++++++++++++++++++++++--- sudoku-app/package.json | 1 + 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/sudoku-app/package-lock.json b/sudoku-app/package-lock.json index 2b70006..8e9af4f 100644 --- a/sudoku-app/package-lock.json +++ b/sudoku-app/package-lock.json @@ -17,6 +17,7 @@ "web-vitals": "^2.1.4" }, "devDependencies": { + "@babel/plugin-proposal-private-property-in-object": "^7.21.11", "gh-pages": "^6.0.0" } }, @@ -628,9 +629,16 @@ } }, "node_modules/@babel/plugin-proposal-private-property-in-object": { - "version": "7.21.0-placeholder-for-preset-env.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", - "integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==", + "version": "7.21.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.11.tgz", + "integrity": "sha512-0QZ8qP/3RLDVBwBFoWAwCtgcDZJVwA5LUJRZU8x2YFfKNuFq161wK3cuGrALu5yiPu+vzwTAg/sMWVNeWeNyaw==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.18.6", + "@babel/helper-create-class-features-plugin": "^7.21.0", + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5" + }, "engines": { "node": ">=6.9.0" }, @@ -1873,6 +1881,17 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/preset-env/node_modules/@babel/plugin-proposal-private-property-in-object": { + "version": "7.21.0-placeholder-for-preset-env.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", + "integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==", + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/preset-env/node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", diff --git a/sudoku-app/package.json b/sudoku-app/package.json index 64d0ca9..4057412 100644 --- a/sudoku-app/package.json +++ b/sudoku-app/package.json @@ -39,6 +39,7 @@ ] }, "devDependencies": { + "@babel/plugin-proposal-private-property-in-object": "^7.21.11", "gh-pages": "^6.0.0" } } From 29e06e51f816171e3a0fb5f0a72c8dbeb8072fa7 Mon Sep 17 00:00:00 2001 From: lly02 Date: Wed, 16 Aug 2023 16:28:54 +0800 Subject: [PATCH 12/30] bugfix: CI=false to build properly --- sudoku-app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sudoku-app/package.json b/sudoku-app/package.json index 4057412..416c7f3 100644 --- a/sudoku-app/package.json +++ b/sudoku-app/package.json @@ -14,7 +14,7 @@ }, "scripts": { "start": "react-scripts start", - "build": "react-scripts build", + "build": "CI=false && react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject", "predeploy": "npm run build", From 45daf73286d1cbc655b11794a23ac1ca57024f5c Mon Sep 17 00:00:00 2001 From: yen Date: Wed, 16 Aug 2023 16:45:12 +0800 Subject: [PATCH 13/30] Update node.js.yml --- .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 f20ee77..c40300e 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -10,7 +10,7 @@ on: branches: [ "feat-github-action" ] jobs: - build: + build-and-deploy: runs-on: ubuntu-latest defaults: From ade4f50ebc00b5533b4263f28d50c09c9e4f0b30 Mon Sep 17 00:00:00 2001 From: yen Date: Wed, 16 Aug 2023 16:53:33 +0800 Subject: [PATCH 14/30] Update node.js.yml --- .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 c40300e..f75cb55 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -32,3 +32,5 @@ jobs: cache-dependency-path: sudoku-app/package-lock.json - run: npm ci - run: npm run deploy + env: + deployment-token: ${{ secret.PERSON_ACCESS_TOKEN_FOR_PUSH_TO_GH_PAGES_BRANCH }} From fcde626d5137d5cb709ee4bddb424836208dc475 Mon Sep 17 00:00:00 2001 From: yen Date: Wed, 16 Aug 2023 17:05:35 +0800 Subject: [PATCH 15/30] Update node.js.yml --- .github/workflows/node.js.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index f75cb55..f5a2225 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -31,6 +31,9 @@ jobs: cache: 'npm' cache-dependency-path: sudoku-app/package-lock.json - run: npm ci - - run: npm run deploy - env: - deployment-token: ${{ secret.PERSON_ACCESS_TOKEN_FOR_PUSH_TO_GH_PAGES_BRANCH }} + - name: Deploy + run: | + git config --global user.email ${{ secrets.MY_EMAIL }} + git config --global user.name ${{ secrets.MY_NAME }} + git remote set-url origin https://github.com/Hack-Weekly/sage-giraffe-sudoku.git + npm run deploy From f59f1d61085eb3f6ee5ae49d46ed7717271a014a Mon Sep 17 00:00:00 2001 From: yen Date: Wed, 16 Aug 2023 17:09:36 +0800 Subject: [PATCH 16/30] Update node.js.yml --- .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 f5a2225..67136e2 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -35,5 +35,5 @@ jobs: run: | git config --global user.email ${{ secrets.MY_EMAIL }} git config --global user.name ${{ secrets.MY_NAME }} - git remote set-url origin https://github.com/Hack-Weekly/sage-giraffe-sudoku.git + git remote set-url origin https://${{ secrets.MY_NAME }}:${{ secrets.PERSON_ACCESS_TOKEN_FOR_PUSH_TO_GH_PAGES_BRANCH }}@github.com/Hack-Weekly/sage-giraffe-sudoku.git npm run deploy From 327277ec7623187155f344d0cfec50c97fcec490 Mon Sep 17 00:00:00 2001 From: yen Date: Wed, 16 Aug 2023 17:13:45 +0800 Subject: [PATCH 17/30] Create jekyll-gh-pages.yml --- .github/workflows/jekyll-gh-pages.yml | 51 +++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/jekyll-gh-pages.yml diff --git a/.github/workflows/jekyll-gh-pages.yml b/.github/workflows/jekyll-gh-pages.yml new file mode 100644 index 0000000..559bddf --- /dev/null +++ b/.github/workflows/jekyll-gh-pages.yml @@ -0,0 +1,51 @@ +# Sample workflow for building and deploying a Jekyll site to GitHub Pages +name: Deploy Jekyll with GitHub Pages dependencies preinstalled + +on: + # Runs on pushes targeting the default branch + push: + branches: ["main"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Pages + uses: actions/configure-pages@v3 + - name: Build with Jekyll + uses: actions/jekyll-build-pages@v1 + with: + source: ./ + destination: ./_site + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 From 9d007555f71b2b53b70f8e5bdcd92f965d6a34f5 Mon Sep 17 00:00:00 2001 From: yen Date: Wed, 16 Aug 2023 17:14:14 +0800 Subject: [PATCH 18/30] Update jekyll-gh-pages.yml --- .github/workflows/jekyll-gh-pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/jekyll-gh-pages.yml b/.github/workflows/jekyll-gh-pages.yml index 559bddf..a75ed75 100644 --- a/.github/workflows/jekyll-gh-pages.yml +++ b/.github/workflows/jekyll-gh-pages.yml @@ -4,7 +4,7 @@ name: Deploy Jekyll with GitHub Pages dependencies preinstalled on: # Runs on pushes targeting the default branch push: - branches: ["main"] + branches: ["feat-github-action"] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: From c30297508bdd65765788f38220b25476b05f488c Mon Sep 17 00:00:00 2001 From: lly02 Date: Wed, 16 Aug 2023 17:18:38 +0800 Subject: [PATCH 19/30] test github action --- sudoku-app/src/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sudoku-app/src/App.js b/sudoku-app/src/App.js index 779e0bf..72e608f 100644 --- a/sudoku-app/src/App.js +++ b/sudoku-app/src/App.js @@ -62,7 +62,7 @@ function App() { switch (difficulty) { case "easy": - holes = 2; + holes = 1; break; case "medium": From 7310d225d99475fec621d63a3864e12007d24477 Mon Sep 17 00:00:00 2001 From: lly02 Date: Wed, 16 Aug 2023 17:20:46 +0800 Subject: [PATCH 20/30] removed unused workflow --- .github/workflows/node.js.yml | 39 ----------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 .github/workflows/node.js.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml deleted file mode 100644 index 67136e2..0000000 --- a/.github/workflows/node.js.yml +++ /dev/null @@ -1,39 +0,0 @@ -# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs - -name: Node.js CI - -on: - push: - branches: [ "feat-github-action" ] - pull_request: - branches: [ "feat-github-action" ] - -jobs: - build-and-deploy: - - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./sudoku-app - - strategy: - matrix: - node-version: [18.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - - steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - cache-dependency-path: sudoku-app/package-lock.json - - run: npm ci - - name: Deploy - run: | - git config --global user.email ${{ secrets.MY_EMAIL }} - git config --global user.name ${{ secrets.MY_NAME }} - git remote set-url origin https://${{ secrets.MY_NAME }}:${{ secrets.PERSON_ACCESS_TOKEN_FOR_PUSH_TO_GH_PAGES_BRANCH }}@github.com/Hack-Weekly/sage-giraffe-sudoku.git - npm run deploy From 375f4c2cbff6f6f04c3d4027942b04957c0a5ac2 Mon Sep 17 00:00:00 2001 From: yen Date: Wed, 16 Aug 2023 18:11:50 +0800 Subject: [PATCH 21/30] Update and rename .github/workflows/jekyll-gh-pages.yml to gh-pages.yml --- .../jekyll-gh-pages.yml => gh-pages.yml | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) rename .github/workflows/jekyll-gh-pages.yml => gh-pages.yml (72%) diff --git a/.github/workflows/jekyll-gh-pages.yml b/gh-pages.yml similarity index 72% rename from .github/workflows/jekyll-gh-pages.yml rename to gh-pages.yml index a75ed75..f0b7444 100644 --- a/.github/workflows/jekyll-gh-pages.yml +++ b/gh-pages.yml @@ -1,5 +1,4 @@ -# Sample workflow for building and deploying a Jekyll site to GitHub Pages -name: Deploy Jekyll with GitHub Pages dependencies preinstalled +name: Deploy React with GitHub Pages dependencies preinstalled on: # Runs on pushes targeting the default branch @@ -28,13 +27,18 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - - name: Setup Pages - uses: actions/configure-pages@v3 - - name: Build with Jekyll - uses: actions/jekyll-build-pages@v1 - with: - source: ./ - destination: ./_site + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + cache-dependency-path: sudoku-app/package-lock.json + - name: Build + env: + CI: false + run: | + npm ci + npm run build - name: Upload artifact uses: actions/upload-pages-artifact@v2 From ef5e1ed3a52e937fdceb9269934901460fe3aeef Mon Sep 17 00:00:00 2001 From: lly02 Date: Wed, 16 Aug 2023 18:13:38 +0800 Subject: [PATCH 22/30] Update workflow --- gh-pages.yml => .github/workflows/gh-pages.yml | 0 sudoku-app/package.json | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename gh-pages.yml => .github/workflows/gh-pages.yml (100%) diff --git a/gh-pages.yml b/.github/workflows/gh-pages.yml similarity index 100% rename from gh-pages.yml rename to .github/workflows/gh-pages.yml diff --git a/sudoku-app/package.json b/sudoku-app/package.json index 416c7f3..4057412 100644 --- a/sudoku-app/package.json +++ b/sudoku-app/package.json @@ -14,7 +14,7 @@ }, "scripts": { "start": "react-scripts start", - "build": "CI=false && react-scripts build", + "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject", "predeploy": "npm run build", From 907e1cc69f85144cf3b7e943e69a8859afb1afd1 Mon Sep 17 00:00:00 2001 From: yen Date: Wed, 16 Aug 2023 18:15:44 +0800 Subject: [PATCH 23/30] Update gh-pages.yml --- .github/workflows/gh-pages.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index f0b7444..0b921e9 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -28,11 +28,11 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - cache-dependency-path: sudoku-app/package-lock.json + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + cache-dependency-path: sudoku-app/package-lock.json - name: Build env: CI: false From e71b80ca64273831e7473617b454c5333bea4464 Mon Sep 17 00:00:00 2001 From: yen Date: Wed, 16 Aug 2023 18:16:47 +0800 Subject: [PATCH 24/30] Update gh-pages.yml --- .github/workflows/gh-pages.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 0b921e9..ee3dbe2 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -24,6 +24,11 @@ jobs: # Build job build: runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x] + steps: - name: Checkout uses: actions/checkout@v3 From da24684137d3533d1f37d671b46136523327e988 Mon Sep 17 00:00:00 2001 From: yen Date: Wed, 16 Aug 2023 18:28:00 +0800 Subject: [PATCH 25/30] Update gh-pages.yml --- .github/workflows/gh-pages.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index ee3dbe2..c19c2fc 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -24,7 +24,9 @@ jobs: # Build job build: runs-on: ubuntu-latest - + defaults: + run: + working-directory: ./sudoku-app strategy: matrix: node-version: [18.x] From 1f5fa362d5b6bc64db403896dc4ce470bc59f568 Mon Sep 17 00:00:00 2001 From: yen Date: Wed, 16 Aug 2023 18:32:13 +0800 Subject: [PATCH 26/30] Update gh-pages.yml --- .github/workflows/gh-pages.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index c19c2fc..924f8e8 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -46,8 +46,13 @@ jobs: run: | npm ci npm run build + - name: Setup Pages + uses: actions/configure-pages@v3 - name: Upload artifact - uses: actions/upload-pages-artifact@v2 + uses: actions/upload-pages-artifact@v1 + with: + # Upload dist repository + path: './sudoku-app/build' # Deployment job deploy: From 2b50ec332530414f9b5c332dad0635206f73e974 Mon Sep 17 00:00:00 2001 From: lly02 Date: Wed, 16 Aug 2023 18:40:52 +0800 Subject: [PATCH 27/30] test github action --- sudoku-app/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/sudoku-app/package.json b/sudoku-app/package.json index 4057412..410e1f9 100644 --- a/sudoku-app/package.json +++ b/sudoku-app/package.json @@ -2,6 +2,7 @@ "name": "sudoku-app", "type": "module", "version": "0.1.0", + "homepage": ".", "private": true, "dependencies": { "@testing-library/jest-dom": "^5.17.0", From 11de1ea586c66f8590c48b310e750b2f5603dad4 Mon Sep 17 00:00:00 2001 From: lly02 Date: Wed, 16 Aug 2023 18:44:26 +0800 Subject: [PATCH 28/30] test github action --- sudoku-app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sudoku-app/package.json b/sudoku-app/package.json index 410e1f9..d7ae86e 100644 --- a/sudoku-app/package.json +++ b/sudoku-app/package.json @@ -2,7 +2,7 @@ "name": "sudoku-app", "type": "module", "version": "0.1.0", - "homepage": ".", + "homepage": "https://hack-weekly.github.io/sage-giraffe-sudoku", "private": true, "dependencies": { "@testing-library/jest-dom": "^5.17.0", From 611e5f7e67c87a102884131c659e9f1726569dcf Mon Sep 17 00:00:00 2001 From: lly02 Date: Wed, 16 Aug 2023 18:46:30 +0800 Subject: [PATCH 29/30] feat: final commit for CICD --- sudoku-app/src/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sudoku-app/src/App.js b/sudoku-app/src/App.js index 72e608f..3214891 100644 --- a/sudoku-app/src/App.js +++ b/sudoku-app/src/App.js @@ -62,7 +62,7 @@ function App() { switch (difficulty) { case "easy": - holes = 1; + holes = 20; break; case "medium": From 8d8eae554d3d36aeb7e87af99f308fa9495f1bef Mon Sep 17 00:00:00 2001 From: lly02 Date: Wed, 16 Aug 2023 18:48:00 +0800 Subject: [PATCH 30/30] bugfix: change branch to main --- .github/workflows/gh-pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 924f8e8..b54e426 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -3,7 +3,7 @@ name: Deploy React with GitHub Pages dependencies preinstalled on: # Runs on pushes targeting the default branch push: - branches: ["feat-github-action"] + branches: ["main"] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: