Migrate away from Vercel #9
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Deploy to Cloudflare Pages" | |
on: [pull_request_target, push] | |
jobs: | |
deploy: | |
runs-on: "ubuntu-latest" | |
permissions: | |
contents: read | |
deployments: write | |
pull-requests: write | |
steps: | |
- name: Add comment | |
if: github.event_name != 'push' | |
uses: mshick/add-pr-comment@v2 | |
with: | |
message-id: "cloudflare-pages-preview" | |
message: | | |
## Deploying with [<img alt="Cloudflare Pages" width="16" src="https://user-images.githubusercontent.com/23264/106598434-9e719e00-654f-11eb-9e59-6167043cfa01.png">](https://pages.dev) Cloudflare Pages | |
🚀 This branch can be previewed at ${{ steps.cloudflare-publish.outputs.url }} | |
| Latest commit: | ${{ github.sha }} | | |
|---------------------------------|------------------------| | |
| Status: | 🔨 Building... | | |
--- | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
cache: "pnpm" | |
node-version: 20 | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build | |
run: pnpm run build | |
- name: Copy Cloudflare configuration files to build directory | |
run: | | |
cp _headers build/ | |
cp _redirects build/ | |
- name: Publish to Cloudflare | |
uses: cloudflare/pages-action@v1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
projectName: "papermc-docs" | |
directory: "build" | |
gitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
- name: Add comment | |
uses: mshick/add-pr-comment@v2 | |
with: | |
message-id: "cloudflare-pages-preview" | |
message: | | |
## Deploying with [<img alt="Cloudflare Pages" width="16" src="https://user-images.githubusercontent.com/23264/106598434-9e719e00-654f-11eb-9e59-6167043cfa01.png">](https://pages.dev) Cloudflare Pages | |
🚀 This branch can be previewed at ${{ steps.cloudflare-publish.outputs.url }} | |
| Latest commit: | ${{ github.sha }} | | |
|---------------------------------|------------------------| | |
| Status: | ✅ Deploy successful! | | |
| Preview URL: | [${{ steps.cloudflare.outputs.url }}](${{ steps.cloudflare.outputs.url }}) | | |
[View logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) |