blankets for theme #63
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: Build and Deploy | |
on: | |
- push | |
- pull_request | |
- workflow_dispatch | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: ${{ !startsWith(github.event.ref, 'refs/tags/') && !contains(github.event.head_commit.message, '[skip build]') }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 6.1 | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build | |
run: pnpm build | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: build | |
path: out | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
if: ${{ !startsWith(github.event.ref, 'refs/tags/') && contains(github.event.head_commit.message, '[deploy]') }} | |
permissions: | |
contents: read | |
deployments: write | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: build | |
path: out | |
- name: Publish | |
uses: cloudflare/pages-action@1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
projectName: next-blog-dev | |
directory: out | |
gitHubToken: ${{ secrets.GITHUB_TOKEN }} |