diff --git a/.github/actions/deploy-cloudflare-worker/action.yml b/.github/actions/deploy-cloudflare-worker/action.yml new file mode 100644 index 000000000..3d1aa52ed --- /dev/null +++ b/.github/actions/deploy-cloudflare-worker/action.yml @@ -0,0 +1,95 @@ +name: 'Print Wrangler Logs' +description: 'Prints Wrangler logs files if exist' +inputs: + WORKERS_AI_API_KEY: + description: 'The Workers AI API Key' + required: true + VECTORIZE_API_KEY: + description: 'The Vectorize API Key' + required: true + BUCKET_ACCESS_KEY_ID: + description: 'The Bucket Access Key ID' + required: true + GOOGLE_CLIENT_SECRET: + description: 'The Google client secret' + required: true + JWT_SECRET: + description: 'The JWT secret' + required: true + MAPBOX_ACCESS_TOKEN: + description: 'The Mapbox access token' + required: true + OPENAI_API_KEY: + description: 'The OpenAI API Key' + required: true + OPENWEATHER_KEY: + description: 'The OpenWeather API Key' + required: true + SEND_GRID_API_KEY: + description: 'The sendgrid API Key' + required: true + STMP_PASSWORD: + description: 'The smtp password' + required: true + X_AMZ_SECURITY_TOKEN: + description: 'The X-Amz-Security-Token' + required: true + JWT_VERIFICATION_KEY: + description: 'The JWT verification key' + required: true + CLOUDFLARE_API_TOKEN: + description: 'Cloudflare API Token' + required: true + CLOUDFLARE_ACCOUNT_ID: + description: 'Cloudflare Account ID' + required: true + CLOUDFLARE_ENVIRONMENT: + description: 'Cloudflare Environment' + required: true + type: choice + options: + - preview + - production +runs: + using: 'composite' + steps: + - name: Migrate database + uses: cloudflare/wrangler-action@v3.3.2 + with: + wranglerVersion: '3.75.0' + apiToken: ${{ inputs.CLOUDFLARE_API_TOKEN }} + accountId: ${{ inputs.CLOUDFLARE_ACCOUNT_ID }} + workingDirectory: server + # INFO: We need to upload secret manually because the default secrets input of this action `cloudflare/wrangler-action@v3.3.2` use the `wrangler secret put` command to upload secrets but this command will do not work non-interactive context. + preCommands: > + echo '---Generate and upload secrets---' && + echo '>> Generate secrets file' && + echo '{}' | jq ' + .BUCKET_ACCESS_KEY_ID="${{ inputs.BUCKET_ACCESS_KEY_ID }}" | + .GOOGLE_CLIENT_SECRET="${{ inputs.GOOGLE_CLIENT_SECRET }}" | + .JWT_SECRET="${{ inputs.JWT_SECRET }}" | + .JWT_VERIFICATION_KEY="${{ inputs.JWT_VERIFICATION_KEY }}" | + .MAPBOX_ACCESS_TOKEN="${{ inputs.MAPBOX_ACCESS_TOKEN }}" | + .OPENAI_API_KEY="${{ inputs.OPENAI_API_KEY }}" | + .OPENWEATHER_KEY="${{ inputs.OPENWEATHER_KEY }}" | + .SEND_GRID_API_KEY="${{ inputs.SEND_GRID_API_KEY }}" | + .STMP_PASSWORD="${{ inputs.STMP_PASSWORD }}" | + .VECTORIZE_API_KEY="${{ inputs.VECTORIZE_API_KEY }}" | + .WORKERS_AI_API_KEY="${{ inputs.WORKERS_AI_API_KEY }}" | + .X_AMZ_SECURITY_TOKEN="${{ inputs.X_AMZ_SECURITY_TOKEN }}" + ' > secrets.json && + echo '<< Secrets file generated' && + echo '>> Upload secrets' && + yarn wrangler secret bulk --env ${{ inputs.CLOUDFLARE_ENVIRONMENT }} secrets.json && + echo '<< Secrets uploaded' + command: deploy src/index.ts --env ${{ inputs.CLOUDFLARE_ENVIRONMENT }} + packageManager: yarn + env: + CI: true + NO_D1_WARNING: true + WRANGLER_LOG: debug + WRANGLER_LOG_SANITIZE: false + + - name: Print wrangler extra logs on failure + if: failure() + uses: ./.github/actions/print-wrangler-logs diff --git a/.github/actions/migrate-d1-database/action.yml b/.github/actions/migrate-d1-database/action.yml new file mode 100644 index 000000000..3388d50f2 --- /dev/null +++ b/.github/actions/migrate-d1-database/action.yml @@ -0,0 +1,40 @@ +name: 'Print Wrangler Logs' +description: 'Prints Wrangler logs files if exist' +inputs: + CLOUDFLARE_API_TOKEN: + description: 'Cloudflare API Token' + required: true + CLOUDFLARE_ACCOUNT_ID: + description: 'Cloudflare Account ID' + required: true + CLOUDFLARE_ENVIRONMENT: + description: 'Cloudflare Environment' + required: true + type: choice + options: + - preview + - production +runs: + using: 'composite' + steps: + - name: Migrate database + uses: cloudflare/wrangler-action@v3.3.2 + with: + wranglerVersion: '3.75.0' + apiToken: ${{ inputs.CLOUDFLARE_API_TOKEN }} + accountId: ${{ inputs.CLOUDFLARE_ACCOUNT_ID }} + workingDirectory: server + preCommands: | + nl -w1 -s': ' wrangler.toml + command: | + d1 migrations apply ${{ inputs.CLOUDFLARE_ENVIRONMENT }} --remote --env ${{ inputs.CLOUDFLARE_ENVIRONMENT }} + packageManager: yarn + env: + NO_D1_WARNING: true + CI: true + WRANGLER_LOG: debug + WRANGLER_LOG_SANITIZE: false + + - name: Print wrangler extra logs on failure + if: failure() + uses: ./.github/actions/print-wrangler-logs diff --git a/.github/actions/print-wrangler-logs/action.yml b/.github/actions/print-wrangler-logs/action.yml new file mode 100644 index 000000000..48d56519f --- /dev/null +++ b/.github/actions/print-wrangler-logs/action.yml @@ -0,0 +1,13 @@ +name: 'Print Wrangler Logs' +description: 'Prints Wrangler logs files if exist' +runs: + using: 'composite' + steps: + - name: Print the last wrangler log file + shell: bash + run: | + cat "$(ls -t /home/runner/.config/.wrangler/logs/* 2> /dev/null | head -n 1)" 2> /dev/null || true; + - name: Delete wrangler log files after printing + shell: bash + run: | + rm /home/runner/.config/.wrangler/logs/* || true && diff --git a/.github/actions/setup-wrangler-toml/action.yml b/.github/actions/setup-wrangler-toml/action.yml index b77ad1f81..a6d2cc0c1 100644 --- a/.github/actions/setup-wrangler-toml/action.yml +++ b/.github/actions/setup-wrangler-toml/action.yml @@ -45,32 +45,50 @@ runs: steps: - name: Generate wrangler.toml shell: bash + working-directory: ${{ github.workspace }}/server + env: + BUCKET_ACCESS_KEY_ID: ${{ inputs.BUCKET_ACCESS_KEY_ID }} + CLOUDFLARE_API_TOKEN: ${{ inputs.CLOUDFLARE_API_TOKEN }} + CLOUDFLARE_ACCOUNT_ID: ${{ inputs.CLOUDFLARE_ACCOUNT_ID}} + CLOUDFLARE_ENVIRONMENT: production + GOOGLE_CLIENT_SECRET: ${{ inputs.GOOGLE_CLIENT_SECRET }} + JWT_SECRET: ${{ inputs.JWT_SECRET }} + JWT_VERIFICATION_KEY: ${{ inputs.JWT_SECRET }} + MAPBOX_ACCESS_TOKEN: ${{ inputs.MAPBOX_ACCESS_TOKEN }} + OPENAI_API_KEY: ${{ inputs.OPENAI_API_KEY }} + OPENWEATHER_KEY: ${{ inputs.OPENWEATHER_KEY }} + SEND_GRID_API_KEY: ${{ inputs.SEND_GRID_API_KEY }} + STMP_PASSWORD: ${{ inputs.STMP_PASSWORD }} + VECTORIZE_API_KEY: ${{ inputs.VECTORIZE_API_KEY }} + WORKERS_AI_API_KEY: ${{ inputs.WORKERS_AI_API_KEY }} + X_AMZ_SECURITY_TOKEN: ${{ inputs.X_AMZ_SECURITY_TOKEN }} run: | - echo 'name = "packrat-api"' > ${{ github.workspace }}/server/wrangler.toml - echo 'main = "src/index.ts"' >> ${{ github.workspace }}/server/wrangler.toml - echo 'compatibility_date = "2024-03-14"' >> ${{ github.workspace }}/server/wrangler.toml - echo 'node_compat = true' >> ${{ github.workspace }}/server/wrangler.toml - echo '[env.${{ inputs.environment }}]' >> ${{ github.workspace }}/server/wrangler.toml - echo '[[env.${{ inputs.environment }}.d1_databases]]' >> ${{ github.workspace }}/server/wrangler.toml - echo 'binding = "DB"' >> ${{ github.workspace }}/server/wrangler.toml - echo 'database_name = "${{ inputs.environment }}"' >> ${{ github.workspace }}/server/wrangler.toml - echo 'database_id = "${{ inputs.DB_ID }}"' >> ${{ github.workspace }}/server/wrangler.toml - echo '[env.${{ inputs.environment }}.ai]' >> ${{ github.workspace }}/server/wrangler.toml - echo 'binding = "AI"' >> ${{ github.workspace }}/server/wrangler.toml - echo '[[env.${{ inputs.environment }}.vectorize]]' >> ${{ github.workspace }}/server/wrangler.toml - echo 'binding = "VECTOR_INDEX"' >> ${{ github.workspace }}/server/wrangler.toml - echo 'index_name = "${{ inputs.VECTOR_INDEX_NAME }}"' >> ${{ github.workspace }}/server/wrangler.toml - echo '[env.${{ inputs.environment }}.vars]' >> ${{ github.workspace }}/server/wrangler.toml - echo 'APP_URL = "${{ inputs.APP_URL }}"' >> ${{ github.workspace }}/server/wrangler.toml - echo 'AWS_SIGN_ALGORITHM = "${{ inputs.AWS_SIGN_ALGORITHM }}"' >> ${{ github.workspace }}/server/wrangler.toml - echo 'BUCKET_ENDPOINT = "${{ inputs.BUCKET_ENDPOINT }}"' >> ${{ github.workspace }}/server/wrangler.toml - echo 'BUCKET_NAME = "${{ inputs.BUCKET_NAME }}"' >> ${{ github.workspace }}/server/wrangler.toml - echo 'BUCKET_REGION = "${{ inputs.BUCKET_REGION }}"' >> ${{ github.workspace }}/server/wrangler.toml - echo 'BUCKET_SERVICE = "${{ inputs.BUCKET_SERVICE }}"' >> ${{ github.workspace }}/server/wrangler.toml - echo 'BUCKET_SESSION_TOKEN = "${{ inputs.BUCKET_SESSION_TOKEN }}"' >> ${{ github.workspace }}/server/wrangler.toml - echo 'CLOUDFLARE_ACCOUNT_ID = "${{ inputs.CLOUDFLARE_ACCOUNT_ID }}"' >> ${{ github.workspace }}/server/wrangler.toml - echo 'GOOGLE_CLIENT_ID = "${{ inputs.GOOGLE_CLIENT_ID }}"' >> ${{ github.workspace }}/server/wrangler.toml - echo 'NODE_ENV = "${{ inputs.environment }}"' >> ${{ github.workspace }}/server/wrangler.toml - echo 'OSM_URI = "https://overpass-api.de/api/interpreter"' >> ${{ github.workspace }}/server/wrangler.toml - echo 'STMP_EMAIL = "${{ inputs.STMP_EMAIL }}"' >> ${{ github.workspace }}/server/wrangler.toml - echo 'WEATHER_URL = "https://api.openweathermap.org/data/2.5/forecast"' >> ${{ github.workspace }}/server/wrangler.toml + echo BUCKET_ACCESS_KEY_ID:${BUCKET_ACCESS_KEY_ID::-2} _ CLOUDFLARE_API_TOKEN:${CLOUDFLARE_API_TOKEN::-2} _ CLOUDFLARE_ACCOUNT_ID:${CLOUDFLARE_ACCOUNT_ID}} CLOUDFLARE_ENVIRONMENT: production GOOGLE_CLIENT_SECRET:${GOOGLE_CLIENT_SECRET::-2} _ JWT_SECRET:${JWT_SECRET::-2} _ JWT_VERIFICATION_KEY:${JWT_SECRET::-2} _ MAPBOX_ACCESS_TOKEN:${MAPBOX_ACCESS_TOKEN::-2} _ OPENAI_API_KEY:${OPENAI_API_KEY::-2} _ OPENWEATHER_KEY:${OPENWEATHER_KEY::-2} _ SEND_GRID_API_KEY:${SEND_GRID_API_KEY::-2} _ STMP_PASSWORD:${STMP_PASSWORD::-2} _ VECTORIZE_API_KEY:${VECTORIZE_API_KEY::-2} _ WORKERS_AI_API_KEY:${WORKERS_AI_API_KEY::-2} _ X_AMZ_SECURITY_TOKEN:${X_AMZ_SECURITY_TOKEN::-2} _ + echo 'name = "packrat-api"' > wrangler.toml + echo 'main = "src/index.ts"' >> wrangler.toml + echo 'compatibility_date = "2024-03-14"' >> wrangler.toml + echo 'node_compat = true' >> wrangler.toml + echo '[env.${{ inputs.environment }}]' >> wrangler.toml + echo '[[env.${{ inputs.environment }}.d1_databases]]' >> wrangler.toml + echo 'binding = "DB"' >> wrangler.toml + echo 'database_name = "${{ inputs.environment }}"' >> wrangler.toml + echo 'database_id = "${{ inputs.DB_ID }}"' >> wrangler.toml + echo '[env.${{ inputs.environment }}.ai]' >> wrangler.toml + echo 'binding = "AI"' >> wrangler.toml + echo '[[env.${{ inputs.environment }}.vectorize]]' >> wrangler.toml + echo 'binding = "VECTOR_INDEX"' >> wrangler.toml + echo 'index_name = "${{ inputs.VECTOR_INDEX_NAME }}"' >> wrangler.toml + echo '[env.${{ inputs.environment }}.vars]' >> wrangler.toml + echo 'APP_URL = "${{ inputs.APP_URL }}"' >> wrangler.toml + echo 'AWS_SIGN_ALGORITHM = "${{ inputs.AWS_SIGN_ALGORITHM }}"' >> wrangler.toml + echo 'BUCKET_ENDPOINT = "${{ inputs.BUCKET_ENDPOINT }}"' >> wrangler.toml + echo 'BUCKET_NAME = "${{ inputs.BUCKET_NAME }}"' >> wrangler.toml + echo 'BUCKET_REGION = "${{ inputs.BUCKET_REGION }}"' >> wrangler.toml + echo 'BUCKET_SERVICE = "${{ inputs.BUCKET_SERVICE }}"' >> wrangler.toml + echo 'BUCKET_SESSION_TOKEN = "${{ inputs.BUCKET_SESSION_TOKEN }}"' >> wrangler.toml + echo 'CLOUDFLARE_ACCOUNT_ID = "${{ inputs.CLOUDFLARE_ACCOUNT_ID }}"' >> wrangler.toml + echo 'GOOGLE_CLIENT_ID = "${{ inputs.GOOGLE_CLIENT_ID }}"' >> wrangler.toml + echo 'NODE_ENV = "${{ inputs.environment }}"' >> wrangler.toml + echo 'OSM_URI = "https://overpass-api.de/api/interpreter"' >> wrangler.toml + echo 'STMP_EMAIL = "${{ inputs.STMP_EMAIL }}"' >> wrangler.toml + echo 'WEATHER_URL = "https://api.openweathermap.org/data/2.5/forecast"' >> wrangler.toml diff --git a/.github/workflows/backend-preview.yml b/.github/workflows/backend-preview.yml index cc543b5e5..ec97c5e56 100644 --- a/.github/workflows/backend-preview.yml +++ b/.github/workflows/backend-preview.yml @@ -47,70 +47,27 @@ jobs: VECTOR_INDEX_NAME: ${{ secrets.PREVIEW_VECTOR_INDEX || 'vector-index-preview' }} - name: Migrate database - uses: cloudflare/wrangler-action@v3.3.2 + uses: ./.github/actions/migrate-d1-database with: - wranglerVersion: '3.75.0' - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID}} - workingDirectory: server - preCommands: | - echo '---Clear previous wrangler logs---' - rm /home/runner/.config/.wrangler/logs/* || true - command: d1 migrations apply preview --remote --env preview - packageManager: yarn - env: - NO_D1_WARNING: true - CI: true - WRANGLER_LOG: debug - WRANGLER_LOG_SANITIZE: false - - - name: Print wrangler extra logs on failure - if: failure() - run: | - cat "$(ls -t /home/runner/.config/.wrangler/logs/* | head -n 1)" || true; + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + CLOUDFLARE_ENVIRONMENT: preview - name: Deploy uses: cloudflare/wrangler-action@v3.3.2 with: - wranglerVersion: '3.75.0' - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID}} - workingDirectory: server - # INFO: We need to upload secret manually because the default secrets input of this action `cloudflare/wrangler-action@v3.3.2` use the `wrangler secret put` command to upload secrets but this command will do not work non-interactive context. - preCommands: > - echo '---Clear previous wrangler logs file---' && - rm /home/runner/.config/.wrangler/logs/* || true && - echo '---Generate and upload secrets---' && - echo '>> Generate secrets file' && - echo '{}' | jq ' - .WORKERS_AI_API_KEY="${{ secrets.PREVIEW_WORKERS_AI_API_KEY }}" | - .VECTORIZE_API_KEY="${{ secrets.PREVIEW_VECTORIZE_API_KEY }}" | - .BUCKET_ACCESS_KEY_ID="${{ secrets.PREVIEW_BUCKET_ACCESS_KEY_ID }}" | - .GOOGLE_CLIENT_SECRET="${{ secrets.PREVIEW_GOOGLE_CLIENT_SECRET }}" | - .JWT_SECRET="${{ secrets.PREVIEW_JWT_SECRET }}" | - .MAPBOX_ACCESS_TOKEN="${{ secrets.PREVIEW_MAPBOX_ACCESS_TOKEN }}" | - .OPENAI_API_KEY="${{ secrets.PREVIEW_OPENAI_API_KEY }}" | - .OPENWEATHER_KEY="${{ secrets.PREVIEW_OPENWEATHER_KEY }}" | - .SEND_GRID_API_KEY="${{ secrets.PREVIEW_SEND_GRID_API_KEY }}" | - .STMP_PASSWORD="${{ secrets.PREVIEW_STMP_PASSWORD }}" | - .VECTORIZE_API_KEY="${{ secrets.PREVIEW_VECTORIZE_API_KEY }}" | - .X_AMZ_SECURITY_TOKEN="${{ secrets.PREVIEW_X_AMZ_SECURITY_TOKEN }}" | - .JWT_VERIFICATION_KEY="${{ secrets.PREVIEW_JWT_SECRET }}" - ' > secrets.json && - echo '<< Secrets file generated' && - echo '>> Upload secrets' && - yarn wrangler secret bulk --env preview secrets.json && - echo '<< Secrets uploaded' - command: deploy src/index.ts --env preview - packageManager: yarn - env: - CI: true - NO_D1_WARNING: true - WRANGLER_LOG: debug - WRANGLER_LOG_SANITIZE: false - - - name: Print wrangler extra logs on failure - if: failure() - run: | - cat "$(ls -t /home/runner/.config/.wrangler/logs/* | head -n 1)" || true; - + BUCKET_ACCESS_KEY_ID: ${{ secrets.PREVIEW_BUCKET_ACCESS_KEY_ID }} + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + CLOUDFLARE_ENVIRONMENT: preview + GOOGLE_CLIENT_SECRET: ${{ secrets.PREVIEW_GOOGLE_CLIENT_SECRET }} + JWT_SECRET: ${{ secrets.PREVIEW_JWT_SECRET }} + JWT_VERIFICATION_KEY: ${{ secrets.PREVIEW_JWT_SECRET }} + MAPBOX_ACCESS_TOKEN: ${{ secrets.PREVIEW_MAPBOX_ACCESS_TOKEN }} + OPENAI_API_KEY: ${{ secrets.PREVIEW_OPENAI_API_KEY }} + OPENWEATHER_KEY: ${{ secrets.PREVIEW_OPENWEATHER_KEY }} + SEND_GRID_API_KEY: ${{ secrets.PREVIEW_SEND_GRID_API_KEY }} + STMP_PASSWORD: ${{ secrets.PREVIEW_STMP_PASSWORD }} + VECTORIZE_API_KEY: ${{ secrets.PREVIEW_VECTORIZE_API_KEY }} + WORKERS_AI_API_KEY: ${{ secrets.PREVIEW_WORKERS_AI_API_KEY }} + X_AMZ_SECURITY_TOKEN: ${{ secrets.PREVIEW_X_AMZ_SECURITY_TOKEN }} diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 343e07019..cb7a018cd 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -6,6 +6,7 @@ on: branches: - main - andrew_testing + - fix/backend-deployment-failure paths: - '.github/workflows/backend.yml' - 'packages/validations/**' @@ -49,72 +50,28 @@ jobs: VECTOR_INDEX_NAME: ${{ secrets.VECTOR_INDEX }} - name: Migrate database - uses: cloudflare/wrangler-action@v3.3.2 + uses: ./.github/actions/migrate-d1-database with: - wranglerVersion: '3.75.0' - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID}} - workingDirectory: server - preCommands: | - echo '---Clear previous wrangler logs---' - rm /home/runner/.config/.wrangler/logs/* || true - command: d1 migrations apply production --remote --env production - packageManager: yarn - env: - NO_D1_WARNING: true - CI: true - WRANGLER_LOG: debug - WRANGLER_LOG_SANITIZE: false - - - name: Print wrangler extra logs on failure - if: failure() - run: | - cat "$(ls -t /home/runner/.config/.wrangler/logs/* | head -n 1)" || true; + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID}} + CLOUDFLARE_ENVIRONMENT: production - name: Deploy - uses: cloudflare/wrangler-action@v3.3.2 + uses: ./.github/actions/deploy-cloudflare-worker with: - wranglerVersion: '3.75.0' - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID}} - workingDirectory: server - # INFO: We need to upload secret manually because the default secrets input of this action `cloudflare/wrangler-action@v3.3.2` use the `wrangler secret put` command to upload secrets but this command will do not work non-interactive context. - preCommands: > - echo '---Clear previous wrangler logs file---' && - rm /home/runner/.config/.wrangler/logs/* || true && - echo '---Generate and upload secrets---' && - echo '>> Generate secrets file' && - echo '{}' | jq ' - .WORKERS_AI_API_KEY="${{ secrets.WORKERS_AI_API_KEY }}" | - .VECTORIZE_API_KEY="${{ secrets.VECTORIZE_API_KEY }}" | - .BUCKET_ACCESS_KEY_ID="${{ secrets.BUCKET_ACCESS_KEY_ID }}" | - .GOOGLE_CLIENT_SECRET="${{ secrets.GOOGLE_CLIENT_SECRET }}" | - .JWT_SECRET="${{ secrets.JWT_SECRET }}" | - .MAPBOX_ACCESS_TOKEN="${{ secrets.MAPBOX_ACCESS_TOKEN }}" | - .OPENAI_API_KEY="${{ secrets.OPENAI_API_KEY }}" | - .OPENWEATHER_KEY="${{ secrets.OPENWEATHER_KEY }}" | - .SEND_GRID_API_KEY="${{ secrets.SEND_GRID_API_KEY }}" | - .STMP_PASSWORD="${{ secrets.STMP_PASSWORD }}" | - .VECTORIZE_API_KEY="${{ secrets.VECTORIZE_API_KEY }}" | - .X_AMZ_SECURITY_TOKEN="${{ secrets.X_AMZ_SECURITY_TOKEN }}" | - .JWT_VERIFICATION_KEY="${{ secrets.JWT_SECRET }}" - ' > secrets.json && - echo '<< Secrets file generated' && - echo '>> Upload secrets' && - yarn wrangler secret bulk --env production secrets.json && - echo '<< Secrets uploaded' - command: deploy src/index.ts --env production - packageManager: yarn - env: - CI: true - NO_D1_WARNING: true - WRANGLER_LOG: debug - WRANGLER_LOG_SANITIZE: false - - - name: Print wrangler extra logs on failure - if: failure() - run: | - cat "$(ls -t /home/runner/.config/.wrangler/logs/* | head -n 1)" || true; - - + BUCKET_ACCESS_KEY_ID: ${{ secrets.BUCKET_ACCESS_KEY_ID }} + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID}} + CLOUDFLARE_ENVIRONMENT: production + GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }} + JWT_SECRET: ${{ secrets.JWT_SECRET }} + JWT_VERIFICATION_KEY: ${{ secrets.JWT_SECRET }} + MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + OPENWEATHER_KEY: ${{ secrets.OPENWEATHER_KEY }} + SEND_GRID_API_KEY: ${{ secrets.SEND_GRID_API_KEY }} + STMP_PASSWORD: ${{ secrets.STMP_PASSWORD }} + VECTORIZE_API_KEY: ${{ secrets.VECTORIZE_API_KEY }} + WORKERS_AI_API_KEY: ${{ secrets.WORKERS_AI_API_KEY }} + X_AMZ_SECURITY_TOKEN: ${{ secrets.X_AMZ_SECURITY_TOKEN }}