Skip to content

*push*

*push* #64

Workflow file for this run

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 }}