Remove unnecessary variable. #11
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 Cloudflare Workers | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'cloudflare-workers/**' | |
| workflow_dispatch: # Allow manual triggering | |
| jobs: | |
| changes: # Use https://github.com/dorny/paths-filter to check what workers were changed | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: read | |
| outputs: | |
| gumroad-products: ${{ steps.filter.outputs.gumroad-products }} | |
| # If I add more filters below, I need to “export them” here. | |
| steps: | |
| # For pull requests it's not necessary to checkout the code | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| gumroad-products: | |
| - 'cloudflare-workers/gumroad-products/**' | |
| # I can add more filters here and access them separately. | |
| deploy-gumroad-products: | |
| name: Deploy Gumroad Products Worker | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event_name == 'workflow_dispatch' || needs.changes.outputs.gumroad-products == 'true' }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install Wrangler | |
| run: npm install -g wrangler | |
| - name: Deploy to Cloudflare Workers | |
| working-directory: cloudflare-workers/gumroad-products | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| run: | | |
| wrangler deploy --env production |