feat(docker): 动态识别多 CaaS 平台并重构环境变量注入逻辑 #10
This file contains hidden or 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
| name: Deploy to Deno Deploy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| deno-deploy: | |
| runs-on: ubuntu-latest | |
| name: "Deploy to Deno Deploy" | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 | |
| with: | |
| node-version: 24 | |
| - name: Check Required Secrets | |
| run: | | |
| REQUIRED=(DENO_DEPLOY_TOKEN DENO_PROJECT DENO_ORG) | |
| for var in "${REQUIRED[@]}"; do | |
| if [ -z "${!var}" ]; then | |
| echo "❌ Error: $var is missing." | |
| exit 1 | |
| fi | |
| done | |
| env: | |
| DENO_DEPLOY_TOKEN: ${{ secrets.DENO_DEPLOY_TOKEN }} | |
| DENO_PROJECT: ${{ secrets.DENO_PROJECT }} | |
| DENO_ORG: ${{ secrets.DENO_ORG }} | |
| - name: Inject Commit Hash & Platform | |
| run: node scripts/inject_vars.js --platform=deno | |
| - name: Update Deno Configuration | |
| run: node scripts/update_deno.js | |
| env: | |
| DENO_PROJECT: ${{ secrets.DENO_PROJECT }} | |
| DENO_ORG: ${{ secrets.DENO_ORG }} | |
| - name: Setup Deno | |
| uses: denoland/setup-deno@v2 | |
| with: | |
| deno-version: v2.x | |
| - name: Install dependencies | |
| run: npm install --omit=dev | |
| - name: Deploy to Deno Deploy | |
| run: deno deploy --prod --org ${{ secrets.DENO_ORG }} --app ${{ secrets.DENO_PROJECT }} | |
| env: | |
| DENO_DEPLOY_TOKEN: ${{ secrets.DENO_DEPLOY_TOKEN }} | |
| - name: Success Notification | |
| run: echo "🚀 NodeAuth deployed successfully to Deno Deploy!" |