Skip to content

Commit

Permalink
feat: Update Cloudflare Workers deployment workflow to include reposi…
Browse files Browse the repository at this point in the history
…tory name

This commit updates the Cloudflare Workers deployment workflow to include the extraction of the repository name. By utilizing the GitHub Actions `::set-output` command, the repository name is extracted from the `GITHUB_REPOSITORY` environment variable and stored as an output. This output is then used as a parameter in the `wrangler deploy` command, ensuring that the deployed Cloudflare Worker is associated with the correct repository. This enhancement improves the accuracy and organization of the deployment process.
  • Loading branch information
xuelink committed May 20, 2024
1 parent a201e85 commit 3dcdf46
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,15 @@ jobs:
- name: Install Wrangler
run: npm install -g wrangler

- name: Extract repository name
id: extract
run: echo "::set-output name=repo_name::${GITHUB_REPOSITORY##*/}"

- name: Publish to Cloudflare Workers
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
run: wrangler publish
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: wrangler deploy src/index.js --name ${{ steps.extract.outputs.repo_name }} --account-id ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}

- name: Run Discord script
env:
Expand Down

0 comments on commit 3dcdf46

Please sign in to comment.