Skip to content

Commit b07252e

Browse files
committed
ci: enhance cloudflare deployment with metadata and native secret handling
update the wrangler action to use native secret management instead of manual commands and add deployment metadata for better traceability. required permissions for the github deployments api are also added.
1 parent ab9c79e commit b07252e

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

.github/workflows/ci_cd.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ jobs:
146146
group: ci-${{ github.ref }}
147147
cancel-in-progress: true
148148
needs: [test]
149+
permissions:
150+
contents: read
151+
deployments: write
149152
if: |
150153
always() &&
151154
needs.test.result == 'success' &&
@@ -183,8 +186,11 @@ jobs:
183186
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
184187
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
185188
workingDirectory: projects/client
186-
wranglerVersion: latest
187-
command: deploy
188-
preCommands: |
189-
echo "${{ secrets.TRAKT_CLIENT_ID }}" | npx wrangler secret put TRAKT_CLIENT_ID
190-
echo "${{ secrets.TRAKT_CLIENT_SECRET }}" | npx wrangler secret put TRAKT_CLIENT_SECRET
189+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
190+
command: deploy --message "sha=${{ github.sha }} run=${{ github.run_number }}" --tag "${{ github.sha }}"
191+
secrets: |
192+
TRAKT_CLIENT_ID
193+
TRAKT_CLIENT_SECRET
194+
env:
195+
TRAKT_CLIENT_ID: ${{ secrets.TRAKT_CLIENT_ID }}
196+
TRAKT_CLIENT_SECRET: ${{ secrets.TRAKT_CLIENT_SECRET }}

0 commit comments

Comments
 (0)