From c0afd1fea9b872b3d4df4c8843ed0932511e9516 Mon Sep 17 00:00:00 2001 From: vcoppe Date: Wed, 4 Nov 2026 18:46:23 +0100 Subject: [PATCH] cloudflare build only --- .github/workflows/deploy-cloudflare.yml | 67 ------------------------- .github/workflows/deploy.yml | 50 ++++++++---------- 2 files changed, 21 insertions(+), 96 deletions(-) delete mode 100644 .github/workflows/deploy-cloudflare.yml diff --git a/.github/workflows/deploy-cloudflare.yml b/.github/workflows/deploy-cloudflare.yml deleted file mode 100644 index 82d60dbc1..000000000 --- a/.github/workflows/deploy-cloudflare.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Deploy to Cloudflare Pages -on: - push: - branches: 'dev' - workflow_dispatch: - -concurrency: - group: cloudflare-${{ github.ref }} - cancel-in-progress: true - -jobs: - deploy: - runs-on: ubuntu-latest - - permissions: - contents: read - deployments: write - - steps: - - name: Checkout - uses: actions/checkout@v5 - - - name: Install Node.js - uses: actions/setup-node@v6 - with: - node-version: 24 - cache: npm - cache-dependency-path: website/package-lock.json - - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - targets: wasm32-unknown-unknown - - - name: Install wasm-pack - uses: taiki-e/install-action@v2 - with: - tool: wasm-pack - - - name: Test gpx-rs - run: cargo test - - - name: Build wasm - run: wasm-pack build --target bundler - working-directory: wasm - - - name: Install dependencies for website - run: npm install --prefix website - - - name: Test website - run: npm test --prefix website - - - name: Create env file - run: echo PUBLIC_MAPTILER_KEY=${{ secrets.PUBLIC_MAPTILER_KEY }} >> website/.env - - - name: Build website - env: - BASE_PATH: '' - run: npm run build --prefix website - - - name: Deploy to Cloudflare Pages - uses: cloudflare/wrangler-action@v3 - with: - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - command: pages deploy website/build --project-name=${{ vars.CLOUDFLARE_PROJECT_NAME || 'gpxstudio' }} --branch=${{ github.ref_name }} --commit-dirty=true - gitHubToken: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7b97a1c22..90cbff912 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,11 +1,21 @@ -name: Deploy to GitHub Pages +name: Deploy to Cloudflare Pages on: push: - branches: 'main' + branches: ['main', 'dev'] + workflow_dispatch: + +concurrency: + group: cloudflare-${{ github.ref }} + cancel-in-progress: true jobs: - build_site: + deploy: runs-on: ubuntu-latest + + permissions: + contents: read + deployments: write + steps: - name: Checkout uses: actions/checkout@v5 @@ -41,35 +51,17 @@ jobs: run: npm test --prefix website - name: Create env file - run: | - touch website/.env - echo PUBLIC_MAPTILER_KEY=${{ secrets.PUBLIC_MAPTILER_KEY }} >> website/.env - cat website/.env + run: echo PUBLIC_MAPTILER_KEY=${{ secrets.PUBLIC_MAPTILER_KEY }} >> website/.env - name: Build website env: BASE_PATH: '' - run: | - npm run build --prefix website + run: npm run build --prefix website - - name: Upload Artifacts - uses: actions/upload-pages-artifact@v4 + - name: Deploy to Cloudflare Pages + uses: cloudflare/wrangler-action@v3 with: - path: 'website/build/' - - deploy: - needs: build_site - runs-on: ubuntu-latest - - permissions: - pages: write - id-token: write - - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - - steps: - - name: Deploy - id: deployment - uses: actions/deploy-pages@v4 + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + command: pages deploy website/build --project-name=${{ vars.CLOUDFLARE_PROJECT_NAME || 'gpxstudio' }} --branch=${{ github.ref_name }} --commit-dirty=true + gitHubToken: ${{ secrets.GITHUB_TOKEN }}