diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml new file mode 100644 index 000000000..0f227da53 --- /dev/null +++ b/.github/workflows/deploy-staging.yml @@ -0,0 +1,17 @@ +name: Staging CI & CD + +on: + workflow_dispatch: + +jobs: + deploy-staging: + runs-on: ubuntu-latest + environment: Staging + steps: + - name: Deploy to Staging Server + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.STG_SSH_HOST }} + username: root + key: ${{ secrets.STG_SSH_KEY }} + script: bash /opt/openisle/deploy-staging.sh diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5ca720cda..22109dea6 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,9 +1,9 @@ name: CI & CD on: - push: - branches: [main] workflow_dispatch: + schedule: + - cron: "0 19 * * *" # 每天 UTC 19:00,相当于北京时间凌晨3点 jobs: build-and-deploy: @@ -13,22 +13,6 @@ jobs: steps: - uses: actions/checkout@v4 - # - uses: actions/setup-java@v4 - # with: - # java-version: '17' - # distribution: 'temurin' - - # - run: mvn -B clean package -DskipTests - - # - uses: actions/setup-node@v4 - # with: - # node-version: '20' - - # - run: | - # cd open-isle-cli - # npm ci - # npm run build - - name: Deploy to Server uses: appleboy/ssh-action@v1.0.3 with: diff --git a/frontend_nuxt/.env.example b/frontend_nuxt/.env.example index a33109802..5949d37b1 100644 --- a/frontend_nuxt/.env.example +++ b/frontend_nuxt/.env.example @@ -1,4 +1,13 @@ +; 本地部署后端 +; NUXT_PUBLIC_API_BASE_URL=https://127.0.0.1:8081 +; 预发环境后端 +; NUXT_PUBLIC_API_BASE_URL=https://staging.open-isle.com +; 生产环境后端 NUXT_PUBLIC_API_BASE_URL=https://www.open-isle.com + +; 预发环境 +; NUXT_PUBLIC_WEBSITE_BASE_URL=https://staging.open-isle.com +; 正式环境/生产环境 NUXT_PUBLIC_WEBSITE_BASE_URL=https://www.open-isle.com NUXT_PUBLIC_GOOGLE_CLIENT_ID=777830451304-nt8afkkap18gui4f9entcha99unal744.apps.googleusercontent.com NUXT_PUBLIC_GITHUB_CLIENT_ID=Ov23liVkO1NPAX5JyWxJ diff --git a/frontend_nuxt/.env.staging.example b/frontend_nuxt/.env.staging.example index 1cf99de76..ebc0678d7 100644 --- a/frontend_nuxt/.env.staging.example +++ b/frontend_nuxt/.env.staging.example @@ -1,5 +1,14 @@ +; 本地部署后端 +; NUXT_PUBLIC_API_BASE_URL=https://127.0.0.1:8081 +; 预发环境后端 NUXT_PUBLIC_API_BASE_URL=https://staging.open-isle.com +; 生产环境后端 +; NUXT_PUBLIC_API_BASE_URL=https://www.open-isle.com + +; 预发环境 NUXT_PUBLIC_WEBSITE_BASE_URL=https://staging.open-isle.com +; 正式环境/生产环境 +; NUXT_PUBLIC_WEBSITE_BASE_URL=https://www.open-isle.com NUXT_PUBLIC_GOOGLE_CLIENT_ID=777830451304-nt8afkkap18gui4f9entcha99unal744.apps.googleusercontent.com NUXT_PUBLIC_GITHUB_CLIENT_ID=Ov23liVkO1NPAX5JyWxJ NUXT_PUBLIC_DISCORD_CLIENT_ID=1394985417044000779 diff --git a/frontend_nuxt/package-lock.json b/frontend_nuxt/package-lock.json index 98cf40da3..fadb31ec0 100644 --- a/frontend_nuxt/package-lock.json +++ b/frontend_nuxt/package-lock.json @@ -5946,9 +5946,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.201", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.201.tgz", - "integrity": "sha512-ZG65vsrLClodGqywuigc+7m0gr4ISoTQttfVh7nfpLv0M7SIwF4WbFNEOywcqTiujs12AUeeXbFyQieDICAIxg==", + "version": "1.5.202", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.202.tgz", + "integrity": "sha512-NxbYjRmiHcHXV1Ws3fWUW+SLb62isauajk45LUJ/HgIOkUA7jLZu/X2Iif+X9FBNK8QkF9Zb4Q2mcwXCcY30mg==", "license": "ISC" }, "node_modules/emoji-regex": {