From fdf6aa59c70bd585a98f9d60e36997546b581b1b Mon Sep 17 00:00:00 2001 From: lucasfelixc Date: Thu, 1 Oct 2026 09:19:06 -0300 Subject: [PATCH] chore: update deploy environment --- .github/workflows/deploy-examples.yml | 47 +++++++-------------------- 1 file changed, 11 insertions(+), 36 deletions(-) diff --git a/.github/workflows/deploy-examples.yml b/.github/workflows/deploy-examples.yml index 75664cd..1534b3a 100644 --- a/.github/workflows/deploy-examples.yml +++ b/.github/workflows/deploy-examples.yml @@ -4,12 +4,19 @@ on: push: branches: [main] +permissions: + contents: read + +concurrency: + group: deploy-examples + cancel-in-progress: false + jobs: deploy: runs-on: ubuntu-latest - permissions: - contents: read - deployments: write + environment: + name: production + url: ${{ steps.deploy.outputs.url }} steps: - uses: actions/checkout@v4 @@ -65,45 +72,13 @@ jobs: EOF - - name: Create GitHub deployment - id: create-deployment - uses: actions/github-script@v7 - with: - result-encoding: string - script: | - const { data } = await github.rest.repos.createDeployment({ - owner: context.repo.owner, - repo: context.repo.repo, - ref: context.sha, - environment: 'production', - auto_merge: false, - required_contexts: [], - description: 'Cloudflare Workers', - }); - return String(data.id); - - name: Deploy to Cloudflare id: deploy run: | - OUTPUT=$(pnpm dlx wrangler deploy --assets=./pages 2>&1) + OUTPUT=$(pnpm dlx wrangler@4.145.0 deploy --assets=./pages 2>&1) echo "$OUTPUT" URL=$(echo "$OUTPUT" | grep -oE 'https://[a-zA-Z0-9._-]+\.workers\.dev' | tail -1) echo "url=$URL" >> $GITHUB_OUTPUT env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - - - name: Update deployment status - if: always() - uses: actions/github-script@v7 - with: - script: | - await github.rest.repos.createDeploymentStatus({ - owner: context.repo.owner, - repo: context.repo.repo, - deployment_id: ${{ steps.create-deployment.outputs.result }}, - state: '${{ steps.deploy.outcome }}' === 'success' ? 'success' : 'failure', - environment_url: '${{ steps.deploy.outputs.url }}', - log_url: `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`, - auto_inactive: true, - });