name: Publish www on: push: branches: - dev paths: - 'apps/www/**' pull_request: branches: - dev paths: - 'apps/www/**' # Allows you to run this workflow manually from the Actions tab # eslint-disable-next-line yml/no-empty-mapping-value workflow_dispatch: 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 - name: Setup Node.js environment uses: actions/setup-node@v2 with: node-version: 18 - uses: pnpm/action-setup@v2 name: Install pnpm with: version: 8 run_install: false - name: Get pnpm store directory shell: bash run: | echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - uses: actions/cache@v3 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 --frozen-lockfile - name: Build www run: pnpm build # Run a action to publish docs - name: Publish to Cloudflare Pages uses: unlike-ltd/github-actions-cloudflare-pages@v1.1.2 with: cloudflare-api-token: ${{ secrets.CLOUDFLARE_API_TOKEN }} cloudflare-account-id: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} cloudflare-project-name: shadcn-vue directory: .vitepress/dist github-token: ${{ secrets.GITHUB_TOKEN }} github-environment: ${{ github.event.pull_request.head.ref }} # uses: cloudflare/pages-action@v1.5.0 # with: # apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} # accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} # projectName: shadcn-vue # directory: .vitepress/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: refs/pull/${{ github.event.number }}/merge # # Optional: Change the working directory # workingDirectory: apps/www # wranglerVersion: '3'