From 6dda2a5f64809480cdaa5d5dd54bf2ba9100a3eb Mon Sep 17 00:00:00 2001 From: GlooriousWalrus Date: Tue, 28 Nov 2023 02:37:02 +0200 Subject: [PATCH 1/2] Create cloudflarepages.yml build and deploy to cloudflare pages. --- .github/workflows/cloudflarepages.yml | 47 +++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/cloudflarepages.yml diff --git a/.github/workflows/cloudflarepages.yml b/.github/workflows/cloudflarepages.yml new file mode 100644 index 0000000..d1ef3b1 --- /dev/null +++ b/.github/workflows/cloudflarepages.yml @@ -0,0 +1,47 @@ +name: cloudflarepages + +on: + push: + branches: [ "main" ] + +env: + CARGO_TERM_COLOR: always + +concurrency: + group: "pages" + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + deployments: write + name: Publish to Cloudflare Pages + steps: + - name: Checkout + uses: actions/checkout@v3 + + # Run a build step here if your project requires + - name: Setup Yarn + # You may pin to the exact commit or the version. + # uses: mskelton/setup-yarn@3c5d9b1e9b3fef69d05b4968efb613594da89f87 + uses: mskelton/setup-yarn@v1.6.0 + - name: build + run: yarn install_trunk && yarn build + + - name: Publish to Cloudflare Pages + uses: cloudflare/pages-action@v1.5.0 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: CLOUDFLARE_ACCOUNT_ID + projectName: CLOUDFLARE_PROJECT_NAME + directory: site/dist/ + # Optional: Enable this if you want to have GitHub Deployments triggered + # gitHubToken: ${{ secrets.GITHUB_TOKEN }} + # Optional: Switch what branch you are publishing to. + # By default this will be the branch which triggered this workflow + branch: main + # Optional: Change the working directory + # workingDirectory: my-site + # Optional: Change the Wrangler version, allows you to point to a specific version or a tag such as `beta` + wranglerVersion: '3' From d5504509f0f1e5803f93ad36cbdef8f7ebcd7e5b Mon Sep 17 00:00:00 2001 From: GlooriousWalrus Date: Tue, 28 Nov 2023 02:48:29 +0200 Subject: [PATCH 2/2] Update cloudflarepages.yml --- .github/workflows/cloudflarepages.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cloudflarepages.yml b/.github/workflows/cloudflarepages.yml index d1ef3b1..c2277a7 100644 --- a/.github/workflows/cloudflarepages.yml +++ b/.github/workflows/cloudflarepages.yml @@ -33,8 +33,8 @@ jobs: uses: cloudflare/pages-action@v1.5.0 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - accountId: CLOUDFLARE_ACCOUNT_ID - projectName: CLOUDFLARE_PROJECT_NAME + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + projectName: ${{ vars.CLOUDFLARE_PROJECT_NAME }} directory: site/dist/ # Optional: Enable this if you want to have GitHub Deployments triggered # gitHubToken: ${{ secrets.GITHUB_TOKEN }}