-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from EOEFANS/main
version:0.0.3
- Loading branch information
Showing
13 changed files
with
862 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| name: Deploy DEV EOEFANS WEB to Cloudflare pages | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "main","ci" ] | ||
| # pull_request: | ||
| # types: [synchronize, closed] | ||
| # branches: [ "main","ci" ] | ||
|
|
||
| # Environment variables available to all jobs and steps in this workflow | ||
| env: | ||
| APP_LOCATION: "/" # location of your client code | ||
| APP_ARTIFACT_LOCATION: "dist" # location of client code build output | ||
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
| PROJECT_NAME: eoefans-web-dev | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build_and_deploy_job: | ||
| permissions: | ||
| contents: read | ||
| deployments: write | ||
| pull-requests: write # for Azure/static-web-apps-deploy to comment on PRs | ||
| if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') | ||
| runs-on: [ self-hosted, Linux ] | ||
| environment: | ||
| name: 'Development' | ||
|
|
||
| strategy: | ||
| matrix: | ||
| node-version: [18.x] | ||
| # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
|
|
||
| name: Build and Deploy Job | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| with: | ||
| submodules: true | ||
|
|
||
|
|
||
| - uses: actions/setup-node@v3 | ||
| name: Use Node.js ${{ matrix.node-version }} | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
|
|
||
| - uses: pnpm/action-setup@v2 | ||
| name: Install pnpm | ||
| id: pnpm-install | ||
| with: | ||
| version: 7 | ||
| run_install: false | ||
|
|
||
| - name: Get pnpm store directory | ||
| id: pnpm-cache | ||
| shell: bash | ||
| run: | | ||
| echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
| - uses: actions/cache@v3 | ||
| name: Setup pnpm cache | ||
| with: | ||
| path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | ||
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-pnpm-store- | ||
| - name: Install dependencies | ||
| run: pnpm install | ||
|
|
||
| - name: Use pnpm to build | ||
| run: pnpm run build | ||
|
|
||
| # - name: post-build test | ||
| # run: pnpm test | ||
|
|
||
| - name: Publish | ||
| uses: cloudflare/pages-action@1 | ||
| with: | ||
| apiToken: ${{ env.CLOUDFLARE_API_TOKEN }} | ||
| accountId: ${{ env.CLOUDFLARE_ACCOUNT_ID }} | ||
| projectName: ${{ env.PROJECT_NAME }} # e.g. 'my-project' | ||
| directory: ${{ env.APP_ARTIFACT_LOCATION }} # e.g. 'dist' | ||
| gitHubToken: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| close_pull_request_job: | ||
| permissions: | ||
| contents: none | ||
| if: github.event_name == 'pull_request' && github.event.action == 'closed' | ||
| runs-on: [ self-hosted, Linux ] | ||
| name: Close Pull Request Job | ||
| steps: | ||
| - name: Close Pull Request | ||
| id: closepullrequest | ||
| uses: cloudflare/pages-action@1 | ||
| with: | ||
| apiToken: ${{ env.CLOUDFLARE_API_TOKEN }} | ||
| accountId: ${{ env.CLOUDFLARE_ACCOUNT_ID }} | ||
| projectName: ${{ env.RPOJECT_NAME }} # e.g. 'my-project' | ||
| directory: ${{ env.APP_ARTIFACT_LOCATION }} # e.g. 'dist' | ||
| gitHubToken: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # Changelog | ||
|
|
||
| All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. | ||
|
|
||
| ## [0.0.3](/compare/v0.0.2...v0.0.3) (2023-02-19) | ||
|
|
||
|
|
||
| ### ✅ Tests | ||
|
|
||
| * **custom**: 本地测试完成,测试release环境 cf38ad8 | ||
|
|
||
|
|
||
| ### 🐛 Bug Fixes | ||
|
|
||
| * **custom**: 删除js文件内的map映射 7d2f1f5 | ||
|
|
||
|
|
||
|
|
||
| ## [0.0.2](/compare/v0.0.1...v0.0.2) (2023-02-19) | ||
|
|
||
|
|
||
| ### 🎫 Chores | ||
|
|
||
| * **custom**: 添加changelog e06f400 | ||
|
|
||
|
|
||
|
|
||
| ## 0.0.1 (2023-02-19) | ||
|
|
||
|
|
||
| ### ✨ Features | ||
|
|
||
| * **custom**: 添加entry ca939da, closes #15 | ||
|
|
||
|
|
||
| ### 🎫 Chores | ||
|
|
||
| * **custom**: 添加commit规范 77cc224, closes #12 | ||
|
|
||
|
|
||
| ### 🐛 Bug Fixes | ||
|
|
||
| * **custom**: 修复构建错误 1359691 | ||
| * **custom**: 修复token问题 58b1a8d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import { defineConfig } from "vite"; | ||
| import path from "path"; | ||
| import react from "@vitejs/plugin-react-swc"; | ||
| //redictPath | ||
| export const addProjectPath = (originPath: string) => `../${originPath}`; | ||
| import { createHtmlPlugin } from "vite-plugin-html"; | ||
| export default defineConfig({ | ||
| define: { | ||
| __APP_VERSION__: "0.01", | ||
| isdev: true, | ||
| isrelease: false, | ||
| }, | ||
| resolve: { | ||
| alias: { | ||
| "@utils": path.resolve(__dirname, addProjectPath("src/utils")), | ||
| "@components": path.resolve(__dirname, addProjectPath("src/components")), | ||
| "@store": path.resolve(__dirname, addProjectPath("src/store")), | ||
| "@routers": path.resolve(__dirname, addProjectPath("src/routers")), | ||
| "@assets": path.resolve(__dirname, addProjectPath("src/assets")), | ||
| }, | ||
| }, | ||
| plugins: [ | ||
| react(), | ||
| createHtmlPlugin({ | ||
| entry: "src/main.tsx", | ||
| template: "index.html", | ||
| inject: { | ||
| data: { | ||
| injectScript: ``, | ||
| }, | ||
| }, | ||
| }), | ||
| ], | ||
| server: { | ||
| proxy: { | ||
| "/v1": { | ||
| target: "https://api.eoe.best/eoefans-api", | ||
| changeOrigin: true, | ||
| }, | ||
| }, | ||
| }, | ||
| }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| // packagejson | ||
| import packageJson from "../package.json"; | ||
| //sentry | ||
| import viteSentry from "vite-plugin-sentry"; | ||
|
|
||
| import { defineConfig, mergeConfig } from "vite"; | ||
| import viteMasterConfig, { addProjectPath } from "./vite.master.config"; | ||
| const config = mergeConfig( | ||
| viteMasterConfig, | ||
| defineConfig({ | ||
| define: { | ||
| isrelease: true, | ||
| }, | ||
| plugins: [ | ||
| { | ||
| ...viteSentry({ | ||
| configFile: ".sentryclirc", | ||
| sourceMaps: { | ||
| include: [addProjectPath("./dist/assets")], | ||
| }, | ||
| release: "eoefans-web@" + packageJson.version, | ||
| }), | ||
| apply: "build", | ||
| }, | ||
| ], | ||
| }) | ||
| ); | ||
|
|
||
| export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.