From 51b6ada2cba2a5ffad5424b48c08f3c92769d7a5 Mon Sep 17 00:00:00 2001 From: platane Date: Sun, 17 Mar 2024 08:05:26 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/_test-e2e.yml | 2 +- .github/workflows/main.yml | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/_test-e2e.yml b/.github/workflows/_test-e2e.yml index f226a4b..4d24cb9 100644 --- a/.github/workflows/_test-e2e.yml +++ b/.github/workflows/_test-e2e.yml @@ -88,4 +88,4 @@ jobs: echo url=$URL >> "$GITHUB_OUTPUT" env: CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_PUBLISH_TOKEN }} + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 625c225..207ad09 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest if: github.ref_type != 'tag' outputs: - published_url: ${{ steps.publish.outputs.url }} + published_url: ${{ steps.deploy.outputs.url }} steps: - uses: actions/checkout@v4 - uses: oven-sh/setup-bun@v1 @@ -17,21 +17,21 @@ jobs: - run: bunx vite build working-directory: packages/app-builder - - name: Publish - id: publish - uses: cloudflare/pages-action@1 - with: - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - projectName: timezone-rocks - directory: dist - gitHubToken: ${{ secrets.GITHUB_TOKEN }} + - name: Deploy + id: deploy + run: | + bunx wrangler pages deploy dist --project-name=timezone-rocks --branch=preview | tee deploy_log.txt + URL=`cat deploy_log.txt | grep -Eo "https://[^ ]*"` + echo url=$URL >> "$GITHUB_OUTPUT" + env: + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} - name: disclaim preview url in commit comment uses: peter-evans/commit-comment@v3 with: body: | - [preview](${{ steps.publish.outputs.url }}) + [preview](${{ steps.deploy.outputs.url }}) - run: bun type - run: bun lint