From 9e6f95da297c9552fe3fa7d15f4c4bc94a1491f1 Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Thu, 21 Mar 2024 00:35:21 +0800 Subject: [PATCH 01/10] ci: add pages-deploy action --- .github/workflows/pages-deploy.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/pages-deploy.yml diff --git a/.github/workflows/pages-deploy.yml b/.github/workflows/pages-deploy.yml new file mode 100644 index 0000000..f8f924d --- /dev/null +++ b/.github/workflows/pages-deploy.yml @@ -0,0 +1,23 @@ +name: pages-deploy +on: + push: + branches: + - main +jobs: + build: + name: Build + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - run: cd website + - name: Setup Node.js environment + uses: actions/setup-node@v4.0.2 + - name: Install dependencies + run: yarn + - name: Build project + run: yarn build + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: build From ba4750efb6d120f22b2bf65efe7831fb4dc79765 Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Thu, 21 Mar 2024 00:37:54 +0800 Subject: [PATCH 02/10] ci: update pages-deploy trigger --- .github/workflows/pages-deploy.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pages-deploy.yml b/.github/workflows/pages-deploy.yml index f8f924d..5ed3817 100644 --- a/.github/workflows/pages-deploy.yml +++ b/.github/workflows/pages-deploy.yml @@ -1,8 +1,11 @@ name: pages-deploy on: + workflow_dispatch: push: branches: - main + paths: + - 'website/' jobs: build: name: Build From 80d30556839cb2e4c585d16e496943ee3b87147a Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Thu, 21 Mar 2024 00:45:24 +0800 Subject: [PATCH 03/10] ci: update pages-deploy --- .github/workflows/pages-deploy.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pages-deploy.yml b/.github/workflows/pages-deploy.yml index 5ed3817..292341c 100644 --- a/.github/workflows/pages-deploy.yml +++ b/.github/workflows/pages-deploy.yml @@ -6,19 +6,20 @@ on: - main paths: - 'website/' + - '.github/workflows/pages-deploy.yml' jobs: build: name: Build runs-on: windows-latest steps: - uses: actions/checkout@v4 - - run: cd website - name: Setup Node.js environment - uses: actions/setup-node@v4.0.2 - - name: Install dependencies - run: yarn + uses: actions/setup-node@v4.0.2 - name: Build project - run: yarn build + run: | + cd website + yarn + yarn build - name: Deploy uses: peaceiris/actions-gh-pages@v3 with: From a9bc62712d385a2c61d4182b1e16bc2336910f88 Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Thu, 21 Mar 2024 00:58:38 +0800 Subject: [PATCH 04/10] Update pages-deploy.yml --- .github/workflows/pages-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pages-deploy.yml b/.github/workflows/pages-deploy.yml index 292341c..59db831 100644 --- a/.github/workflows/pages-deploy.yml +++ b/.github/workflows/pages-deploy.yml @@ -24,4 +24,4 @@ jobs: uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: build + publish_dir: website/build/ From efb4615d8197851cf7f779eff1cdd3bcc47d5fb2 Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Thu, 21 Mar 2024 01:22:27 +0800 Subject: [PATCH 05/10] Update pages-deploy.yml --- .github/workflows/pages-deploy.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pages-deploy.yml b/.github/workflows/pages-deploy.yml index 59db831..afab8b1 100644 --- a/.github/workflows/pages-deploy.yml +++ b/.github/workflows/pages-deploy.yml @@ -1,4 +1,6 @@ name: pages-deploy +permissions: + contents: write on: workflow_dispatch: push: @@ -15,6 +17,8 @@ jobs: - uses: actions/checkout@v4 - name: Setup Node.js environment uses: actions/setup-node@v4.0.2 + with: + cache: yarn - name: Build project run: | cd website @@ -24,4 +28,4 @@ jobs: uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: website/build/ + publish_dir: ./website/build From 5075c22b02b63a37146b06381b107d3f1b9cfa19 Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Thu, 21 Mar 2024 01:23:57 +0800 Subject: [PATCH 06/10] Update pages-deploy.yml --- .github/workflows/pages-deploy.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/pages-deploy.yml b/.github/workflows/pages-deploy.yml index afab8b1..cbddc0b 100644 --- a/.github/workflows/pages-deploy.yml +++ b/.github/workflows/pages-deploy.yml @@ -17,8 +17,6 @@ jobs: - uses: actions/checkout@v4 - name: Setup Node.js environment uses: actions/setup-node@v4.0.2 - with: - cache: yarn - name: Build project run: | cd website From 28307cd90feec8352dfb236dfa64683d866827da Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Thu, 21 Mar 2024 02:03:54 +0800 Subject: [PATCH 07/10] ci: add azure static web app deploy --- .github/workflows/az-swa-deploy.yml | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/az-swa-deploy.yml diff --git a/.github/workflows/az-swa-deploy.yml b/.github/workflows/az-swa-deploy.yml new file mode 100644 index 0000000..09640fb --- /dev/null +++ b/.github/workflows/az-swa-deploy.yml @@ -0,0 +1,30 @@ +name: Azure Static Web Apps CI/CD + +on: + workflow_dispatch: + push: + branches: + - main + paths: + - 'website/**' + - '.github/workflows/az-swa-deploy.yml' + +jobs: + build_and_deploy_job: + runs-on: ubuntu-latest + name: Build and Deploy Job + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Build And Deploy + id: builddeploy + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} + repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for GitHub integrations (i.e. PR comments) + action: "upload" + ###### Repository/Build Configurations ###### + app_location: "website" # App source code path relative to repository root + output_location: "build" # Built app content directory, relative to app_location - optional + ###### End of Repository/Build Configurations ###### From e9574a1f2777ed77bd80ec04c68a4baa79a4da72 Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Thu, 21 Mar 2024 02:04:50 +0800 Subject: [PATCH 08/10] ci: rename azure ci name [skip ci] --- .github/workflows/az-swa-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/az-swa-deploy.yml b/.github/workflows/az-swa-deploy.yml index 09640fb..880085f 100644 --- a/.github/workflows/az-swa-deploy.yml +++ b/.github/workflows/az-swa-deploy.yml @@ -1,4 +1,4 @@ -name: Azure Static Web Apps CI/CD +name: Azure Static Web Apps Deploy on: workflow_dispatch: From 66287ed4544a24eb9221bc83f5c2f0178f7fd037 Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Thu, 21 Mar 2024 02:08:32 +0800 Subject: [PATCH 09/10] ci: update azure static web app deploy ci --- .github/workflows/az-swa-deploy.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/az-swa-deploy.yml b/.github/workflows/az-swa-deploy.yml index 880085f..ac83f09 100644 --- a/.github/workflows/az-swa-deploy.yml +++ b/.github/workflows/az-swa-deploy.yml @@ -12,11 +12,9 @@ on: jobs: build_and_deploy_job: runs-on: ubuntu-latest - name: Build and Deploy Job + name: Deploy steps: - - uses: actions/checkout@v2 - with: - submodules: true + - uses: actions/checkout@v4 - name: Build And Deploy id: builddeploy uses: Azure/static-web-apps-deploy@v1 From dc6093285d04761f4de36b42e5d1a2b6fb3b7fed Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Thu, 21 Mar 2024 02:08:56 +0800 Subject: [PATCH 10/10] ci: remove pages-deploy.yml --- .github/workflows/pages-deploy.yml | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 .github/workflows/pages-deploy.yml diff --git a/.github/workflows/pages-deploy.yml b/.github/workflows/pages-deploy.yml deleted file mode 100644 index cbddc0b..0000000 --- a/.github/workflows/pages-deploy.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: pages-deploy -permissions: - contents: write -on: - workflow_dispatch: - push: - branches: - - main - paths: - - 'website/' - - '.github/workflows/pages-deploy.yml' -jobs: - build: - name: Build - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - name: Setup Node.js environment - uses: actions/setup-node@v4.0.2 - - name: Build project - run: | - cd website - yarn - yarn build - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./website/build