From 13e372b91c48a1b6d06a2e0f584cfe5e9c8436fd Mon Sep 17 00:00:00 2001 From: zernonia Date: Thu, 19 Dec 2024 20:49:58 +0800 Subject: [PATCH] chore: move worklow to dedicated --- .github/workflows/publish-unovue.yaml | 69 +++++++++++++++++++++++++++ .github/workflows/publish.yaml | 17 ------- docs/README.md | 2 - 3 files changed, 69 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/publish-unovue.yaml diff --git a/.github/workflows/publish-unovue.yaml b/.github/workflows/publish-unovue.yaml new file mode 100644 index 0000000..eca3213 --- /dev/null +++ b/.github/workflows/publish-unovue.yaml @@ -0,0 +1,69 @@ +name: Publish Docs - Unovue + +on: + pull_request: + push: + branches: [master] + paths: + - 'docs/**' +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + deployments: write + name: Publish to Cloudflare Pages + steps: + - name: Checkout + uses: actions/checkout@v4 + + # Run a build step here + - name: Setup Node.js environment + uses: actions/setup-node@v4 + with: + node-version: 18 + + - uses: pnpm/action-setup@v2 + name: Install pnpm + with: + version: 9 + run_install: false + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v4 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm i --no-frozen-lockfile + + - name: Build Motion + run: pnpm build + + - name: Build Docs + run: pnpm docs:build + + # Run a action to publish docs + - name: Publish to Cloudflare Pages + uses: cloudflare/pages-action@v1.5.0 + with: + apiToken: ${{ secrets.ORG_CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.ORG_CLOUDFLARE_ACCOUNT_ID }} + projectName: motion-vue + directory: 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: docs + wranglerVersion: '3' diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 56a09d5..7842d4b 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -67,20 +67,3 @@ jobs: # Optional: Change the working directory workingDirectory: docs wranglerVersion: '3' - - # Run extra action to publish docs to unovue - - name: Publish to Cloudflare Pages - uses: cloudflare/pages-action@v1.5.0 - with: - apiToken: ${{ secrets.ORG_CLOUDFLARE_API_TOKEN }} - accountId: ${{ secrets.ORG_CLOUDFLARE_ACCOUNT_ID }} - projectName: motion-vue - directory: 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: docs - wranglerVersion: '3' diff --git a/docs/README.md b/docs/README.md index 0bc2dc1..25b5821 100644 --- a/docs/README.md +++ b/docs/README.md @@ -73,5 +73,3 @@ bun run preview ``` Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information. - -bump