Skip to content

Commit

Permalink
add deploy CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuyz0112 committed Dec 20, 2023
1 parent 2dd536c commit 0d4ba48
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Deploy to Cloudflare Pages

on: [push]

jobs:
deploy:
runs-on: ubuntu-latest
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Build
run: cd preview-ui && yarn install && yarn build

- name: Publish to Cloudflare Pages
if: env.CLOUDFLARE_API_TOKEN != ''
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }}
directory: ./preview-ui/dist

0 comments on commit 0d4ba48

Please sign in to comment.