ente/.github/workflows/web-deploy.yml

95 lines
3.3 KiB
YAML
Raw Normal View History

2024-05-10 17:18:46 +00:00
name: "Deploy (web)"
2024-03-08 08:29:54 +00:00
on:
schedule:
# [Note: Run workflow every 24 hours]
2024-03-08 08:29:54 +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/
#
- 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
- name: Build photos
run: yarn build:photos
- name: Publish photos
uses: cloudflare/wrangler-action@v3
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
command: pages deploy --project-name=ente --commit-dirty=true --branch=deploy/photos web/apps/photos/out
2024-03-08 08:29:54 +00:00
- name: Build accounts
run: yarn build:accounts
- name: Publish accounts
uses: cloudflare/wrangler-action@v3
2024-03-08 08:29:54 +00:00
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
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
uses: cloudflare/wrangler-action@v3
2024-03-08 08:29:54 +00:00
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
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
uses: cloudflare/wrangler-action@v3
2024-03-08 08:29:54 +00:00
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
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
uses: cloudflare/wrangler-action@v3
2024-03-28 12:09:33 +00:00
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
command: pages deploy --project-name=ente --commit-dirty=true --branch=deploy/payments web/apps/payments/dist