ci: deploy main to cloudflare pages

pull/286/head
Cryolitia 2024-03-07 08:33:10 +08:00 committed by Rizumu Ayaka
parent 472699cd5a
commit b635df795a
2 changed files with 7 additions and 66 deletions

View File

@ -22,19 +22,11 @@ jobs:
- run: pnpm build
env:
NODE_OPTIONS: --max_old_space_size=4096
- uses: actions/upload-pages-artifact@v1
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
path: docs/.vitepress/dist
deploy:
runs-on: ubuntu-20.04
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
apiToken: ${{ secrets.CLOUDFLARE_PAGES_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_PAGES_ACCOUNT }}
projectName: rle-wiki
directory: docs/.vitepress/dist
wranglerVersion: '3'

View File

@ -1,51 +0,0 @@
# This is a basic workflow to help you get started with Actions
name: Build Next
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "next" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
pages: write
id-token: write
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v3
with:
version: '8.15.4'
- uses: actions/setup-node@v4
with:
cache: 'pnpm'
- run: pnpm install
- run: pnpm run build
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_PAGES_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_PAGES_ACCOUNT }}
projectName: rle-wiki
directory: docs/.vitepress/dist
wranglerVersion: '3'