2024-07-14 12:58:55 +00:00
|
|
|
|
2024-07-14 14:05:12 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
tags:
|
|
|
|
- "v*"
|
2024-07-14 12:58:55 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
depoly:
|
2024-07-14 13:18:28 +00:00
|
|
|
runs-on: fedora-40
|
2024-07-14 12:58:55 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Setup pnpm
|
|
|
|
run: |
|
2024-07-14 13:18:28 +00:00
|
|
|
corepack install
|
2024-07-14 12:58:55 +00:00
|
|
|
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
|
|
|
|
|
2024-07-22 13:59:37 +00:00
|
|
|
- name: Build Dist (Staging)
|
|
|
|
run: pnpm dist -m staging
|
|
|
|
if: env.GITHUB_REF_NAME == 'master'
|
|
|
|
|
2024-07-14 13:18:28 +00:00
|
|
|
- name: Build Dist
|
|
|
|
run: pnpm dist
|
2024-07-22 13:59:37 +00:00
|
|
|
if: env.GITHUB_REF_NAME != 'master'
|
2024-07-14 13:18:28 +00:00
|
|
|
|
2024-07-14 14:05:12 +00:00
|
|
|
- name: Depoly to Preview
|
2024-07-14 12:58:55 +00:00
|
|
|
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
|
2024-07-14 14:15:02 +00:00
|
|
|
if: env.GITHUB_REF_NAME == 'master'
|
2024-07-14 14:05:12 +00:00
|
|
|
|
|
|
|
- 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
|
2024-07-14 14:15:02 +00:00
|
|
|
if: env.GITHUB_REF_NAME != 'master'
|
2024-07-14 12:58:55 +00:00
|
|
|
|