Skip to content

Master:现有代码为旧版本 #5

Merged
merged 10 commits into from
Feb 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
day: "friday"
time: "09:00"
timezone: "Asia/Shanghai"
open-pull-requests-limit: 20
reviewers:
- "EOEFANS/Web-dev"
115 changes: 115 additions & 0 deletions .github/workflows/azure-staticwebapp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# This workflow will build and push a web application to an Azure Static Web App when you change your code.
#
# This workflow assumes you have already created the target Azure Static Web App.
# For instructions see https://docs.microsoft.com/azure/static-web-apps/get-started-portal?tabs=vanilla-javascript
#
# To configure this workflow:
#
# 1. Set up a secret in your repository named AZURE_STATIC_WEB_APPS_API_TOKEN with the value of your Static Web Apps deployment token.
# For instructions on obtaining the deployment token see: https://docs.microsoft.com/azure/static-web-apps/deployment-token-management
#
# 3. Change the values for the APP_LOCATION, API_LOCATION and APP_ARTIFACT_LOCATION, AZURE_STATIC_WEB_APPS_API_TOKEN environment variables (below).
# For instructions on setting up the appropriate configuration values go to https://docs.microsoft.com/azure/static-web-apps/front-end-frameworks
name: Deploy web app to Azure Static Web Apps

on:
push:
branches: [ "main" ]
pull_request:
types: [synchronize, closed]
branches: [ "main" ]

# Environment variables available to all jobs and steps in this workflow
env:
APP_LOCATION: "dist" # location of your client code
API_LOCATION: "" # location of your api source code - optional
APP_ARTIFACT_LOCATION: "" # location of client code build output
AZURE_STATIC_WEB_APPS_API_TOKEN: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} # secret containing deployment token for your static web app
SKIP_APP_BUILD: true

permissions:
contents: read

jobs:
build_and_deploy_job:
permissions:
contents: read # for actions/checkout to fetch code
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 ]

strategy:
matrix:
node-version: [16.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: Deploy build artifacts to Azure
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ env.AZURE_STATIC_WEB_APPS_API_TOKEN }} # secret containing api token for app
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: "upload"
###### Repository/Build Configurations - These values can be configured to match you app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: ${{ env.APP_LOCATION }}
api_location: ${{ env.API_LOCATION }}
app_artifact_location: ${{ env.APP_ARTIFACT_LOCATION }}
skip_app_build: ${{ env.SKIP_APP_BUILD }} #comment this out to use azure oryx build
###### End of Repository/Build Configurations ######

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: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ env.AZURE_STATIC_WEB_APPS_API_TOKEN }} # secret containing api token for app
action: "close"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ node_modules
dist
dist-ssr
*.local
pnpm-lock.yaml

# Editor directories and files
.vscode/*
!.vscode/extensions.json
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<meta name="referrer" content="no-referrer" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="renderer" content="webkit" />
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
<link rel="preconnect" href="https://s1.hdslb.com" crossorigin>
<link rel="dns-prefetch" href="https://s1.hdslb.com">
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
Expand Down
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"postinstall": "patch-package",
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
Expand All @@ -22,13 +21,13 @@
"@reduxjs/toolkit": "^1.9.1",
"axios": "^1.2.3",
"dayjs": "^1.11.7",
"imagesloaded": "^5.0.0",
"intersection-observer": "^0.12.2",
"json-bigint": "^1.0.0",
"loading-attribute-polyfill": "^2.1.0",
"masonic": "^3.7.0",
"material-ui-popup-state": "^5.0.4",
"nanoid": "^4.0.0",
"normalize.css": "^8.0.1",
"patch-package": "^6.5.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-flip-toolkit": "^7.0.17",
Expand All @@ -40,8 +39,8 @@
},
"devDependencies": {
"@babel/core": ">=7.0.0 <8.0.0",
"@faker-js/faker": "^7.6.0",
"@types/imagesloaded": "^4.1.2",
"@types/json-bigint": "^1.0.1",
"@types/node": "^18.11.18",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.9",
Expand All @@ -52,7 +51,7 @@
"rollup-plugin-visualizer": "^5.9.0",
"terser": ">=5.4.0 <6.0.0",
"typescript": "^4.9.3",
"vite": "4.0.3",
"vite": "4.0.4",
"vite-plugin-compression": "^0.5.1"
}
}
}
Loading