tutu/.forgejo/workflows/depoly.yml
thislight 85ac9a236b
All checks were successful
/ depoly (push) Successful in 1m18s
ci: build staging bundle for preview
2024-07-22 21:59:37 +08:00

55 lines
1.4 KiB
YAML

on:
push:
branches:
- master
tags:
- "v*"
jobs:
depoly:
runs-on: fedora-40
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
run: |
corepack install
pnpm config set store-dir /tmp/pnpm-store
- name: Cache Dependencies
id: dependencies-cache
uses: actions/cache@v4
with:
path: /tmp/pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install Dependencies
run: pnpm i
- name: Build Dist (Staging)
run: pnpm dist -m staging
if: env.GITHUB_REF_NAME == 'master'
- name: Build Dist
run: pnpm dist
if: env.GITHUB_REF_NAME != 'master'
- name: Depoly to Preview
uses: https://github.com/cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy --project-name=tututheapp dist
if: env.GITHUB_REF_NAME == 'master'
- name: Depoly to Production
uses: https://github.com/cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy --project-name=tututheapp dist --branch=production
if: env.GITHUB_REF_NAME != 'master'