2024-05-10 17:18:46 +00:00
|
|
|
name: "Deploy (web)"
|
2024-03-08 08:29:54 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
2024-03-14 03:59:40 +00:00
|
|
|
# [Note: Run workflow every 24 hours]
|
2024-03-08 08:29:54 +00:00
|
|
|
#
|
2024-05-10 13:41:59 +00:00
|
|
|
# Run everyday at ~8:00 AM IST (except Sundays).
|
|
|
|
#
|
|
|
|
# First field is minute, second is hour of the day. Last is day of week,
|
|
|
|
# 0 being Sunday.
|
|
|
|
#
|
|
|
|
# Add a few minutes of offset to avoid scheduling on exact hourly
|
|
|
|
# boundaries (recommended by GitHub to avoid congestion).
|
2024-03-08 08:29:54 +00:00
|
|
|
#
|
|
|
|
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
|
|
|
|
# https://crontab.guru/
|
|
|
|
#
|
2024-05-10 13:41:59 +00:00
|
|
|
- cron: "25 2 * * 1-6"
|
2024-03-08 08:29:54 +00:00
|
|
|
# Also allow manually running the workflow
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
deploy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: web
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
|
|
|
|
- name: Setup node and enable yarn caching
|
|
|
|
uses: actions/setup-node@v4
|
|
|
|
with:
|
|
|
|
node-version: 20
|
|
|
|
cache: "yarn"
|
2024-04-04 10:10:17 +00:00
|
|
|
cache-dependency-path: "web/yarn.lock"
|
2024-03-08 08:29:54 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: yarn install
|
|
|
|
|
2024-05-10 13:41:59 +00:00
|
|
|
- name: Build photos
|
|
|
|
run: yarn build:photos
|
|
|
|
|
|
|
|
- name: Publish photos
|
2024-05-10 15:32:41 +00:00
|
|
|
uses: cloudflare/wrangler-action@v3
|
2024-05-10 13:41:59 +00:00
|
|
|
with:
|
|
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
2024-05-10 15:32:41 +00:00
|
|
|
command: pages deploy --project-name=ente --commit-dirty=true --branch=deploy/photos web/apps/photos/out
|
2024-05-10 13:41:59 +00:00
|
|
|
|
2024-03-08 08:29:54 +00:00
|
|
|
- name: Build accounts
|
|
|
|
run: yarn build:accounts
|
|
|
|
|
|
|
|
- name: Publish accounts
|
2024-05-10 15:32:41 +00:00
|
|
|
uses: cloudflare/wrangler-action@v3
|
2024-03-08 08:29:54 +00:00
|
|
|
with:
|
|
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
2024-05-10 15:32:41 +00:00
|
|
|
command: pages deploy --project-name=ente --commit-dirty=true --branch=deploy/accounts web/apps/accounts/out
|
2024-03-08 08:29:54 +00:00
|
|
|
|
|
|
|
- name: Build auth
|
|
|
|
run: yarn build:auth
|
|
|
|
|
|
|
|
- name: Publish auth
|
2024-05-10 15:32:41 +00:00
|
|
|
uses: cloudflare/wrangler-action@v3
|
2024-03-08 08:29:54 +00:00
|
|
|
with:
|
|
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
2024-05-10 15:32:41 +00:00
|
|
|
command: pages deploy --project-name=ente --commit-dirty=true --branch=deploy/auth web/apps/auth/out
|
2024-03-08 08:29:54 +00:00
|
|
|
|
|
|
|
- name: Build cast
|
|
|
|
run: yarn build:cast
|
|
|
|
|
|
|
|
- name: Publish cast
|
2024-05-10 15:32:41 +00:00
|
|
|
uses: cloudflare/wrangler-action@v3
|
2024-03-08 08:29:54 +00:00
|
|
|
with:
|
|
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
2024-05-10 15:32:41 +00:00
|
|
|
command: pages deploy --project-name=ente --commit-dirty=true --branch=deploy/cast web/apps/cast/out
|
2024-03-08 08:29:54 +00:00
|
|
|
|
2024-03-28 12:09:33 +00:00
|
|
|
- name: Build payments
|
|
|
|
run: yarn build:payments
|
|
|
|
|
|
|
|
- name: Publish payments
|
2024-05-10 15:32:41 +00:00
|
|
|
uses: cloudflare/wrangler-action@v3
|
2024-03-28 12:09:33 +00:00
|
|
|
with:
|
|
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
2024-05-10 15:32:41 +00:00
|
|
|
command: pages deploy --project-name=ente --commit-dirty=true --branch=deploy/payments web/apps/payments/dist
|