diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 84674e1e..00d8dfb4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build & Deploy +name: Build on: push: @@ -31,12 +31,8 @@ jobs: SUPABASE_URL: "https://wfzpewmlyiozupulbuur.supabase.co" SUPABASE_ANON_KEY: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6IndmenBld21seWlvenVwdWxidXVyIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTU2NzQzMzksImV4cCI6MjAxMTI1MDMzOX0.SKIL3Q0NOBaMehH0ekFspwgcu3afp3Dl9EDzPqs1nKs" - - name: Deploy to Cloudflare - uses: ubiquity/cloudflare-deploy-action@main + - name: Upload build artifact + uses: actions/upload-artifact@v4 with: - repository: ${{ github.repository }} - production_branch: ${{ github.event.repository.default_branch }} - output_directory: "static" - current_branch: ${{ github.ref_name }} - pull_request_number: ${{ github.event.pull_request.number }} - commit_sha: ${{ github.event.pull_request.head.sha }} + name: static + path: static diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..28d7c039 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,25 @@ +name: Deploy to Cloudflare Pages + +on: + workflow_run: + workflows: ["Build"] + types: + - completed + +jobs: + deploy-to-cloudflare: + name: Automatic Cloudflare Deploy + runs-on: ubuntu-22.04 + steps: + - name: Deploy to Cloudflare + if: ${{ github.event.workflow_run.conclusion == 'success' }} + uses: ubiquity/cloudflare-deploy-action@main + with: + repository: ${{ github.repository }} + production_branch: ${{ github.event.repository.default_branch }} + output_directory: "static" + current_branch: ${{ github.event.workflow_run.head_branch }} + cloudflare_account_id: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + cloudflare_api_token: ${{ secrets.CLOUDFLARE_API_TOKEN }} + commit_sha: ${{ github.event.workflow_run.head_sha }} + workflow_run_id: ${{ github.event.workflow_run.id }}