Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[web] Switch to (almost) continuous deployments

Manav Rathi54c9cdeed873
diff --git a/.github/workflows/auth-lint.yml b/.github/workflows/auth-lint.yml
index 63d644c2e3..e7c42e1a6b 100644
--- a/.github/workflows/auth-lint.yml
+++ b/.github/workflows/auth-lint.yml
@@ -3,7 +3,7 @@ name: "Lint (auth)"
on:
# Run on every push to a branch other than main that changes auth/
push:
- branches-ignore: [main, "deploy/**", "deploy-f/**"]
+ branches-ignore: [main]
paths:
- "auth/**"
- ".github/workflows/auth-lint.yml"
diff --git a/.github/workflows/desktop-lint.yml b/.github/workflows/desktop-lint.yml
index 0c1929e6ac..d1cfda884d 100644
--- a/.github/workflows/desktop-lint.yml
+++ b/.github/workflows/desktop-lint.yml
@@ -3,7 +3,7 @@ name: "Lint (desktop)"
on:
# Run on every push to a branch other than main that changes desktop/
push:
- branches-ignore: [main, "deploy/**", "deploy-f/**"]
+ branches-ignore: [main]
paths:
- "desktop/**"
- ".github/workflows/desktop-lint.yml"
diff --git a/.github/workflows/docs-verify-build.yml b/.github/workflows/docs-verify-build.yml
index 5d31ff8378..addb52a059 100644
--- a/.github/workflows/docs-verify-build.yml
+++ b/.github/workflows/docs-verify-build.yml
@@ -6,7 +6,7 @@ name: "Verify build (docs)"
on:
# Run on every push to a branch other than main that changes docs/
push:
- branches-ignore: [main, "deploy/**", "deploy-f/**"]
+ branches-ignore: [main]
paths:
- "docs/**"
- ".github/workflows/docs-verify-build.yml"
diff --git a/.github/workflows/mobile-lint.yml b/.github/workflows/mobile-lint.yml
index 8abc6f0c73..493185b6bd 100644
--- a/.github/workflows/mobile-lint.yml
+++ b/.github/workflows/mobile-lint.yml
@@ -3,7 +3,7 @@ name: "Lint (mobile)"
on:
# Run on every push to a branch other than main that changes mobile/
push:
- branches-ignore: [main, f-droid, "deploy/**", "deploy-f/**"]
+ branches-ignore: [main, f-droid]
paths:
- "mobile/**"
- ".github/workflows/mobile-lint.yml"
diff --git a/.github/workflows/server-lint.yml b/.github/workflows/server-lint.yml
index 30038b3b9f..c051d02901 100644
--- a/.github/workflows/server-lint.yml
+++ b/.github/workflows/server-lint.yml
@@ -3,7 +3,7 @@ name: "Lint (server)"
on:
# Run on every push to a branch other than main that changes server/
push:
- branches-ignore: [main, "deploy/**", "deploy-f/**"]
+ branches-ignore: [main]
paths:
- "server/**"
- ".github/workflows/server-lint.yml"
diff --git a/.github/workflows/web-deploy-accounts.yml b/.github/workflows/web-deploy-accounts.yml
deleted file mode 100644
index 33da5ee6f1..0000000000
--- a/.github/workflows/web-deploy-accounts.yml
+++ /dev/null
@@ -1,43 +0,0 @@
-name: "Deploy (accounts)"
-
-on:
- push:
- # Run workflow on pushes to the deploy/accounts
- branches: [deploy/accounts, deploy-f/accounts]
-
-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"
- cache-dependency-path: "web/yarn.lock"
-
- - name: Install dependencies
- run: yarn install
-
- - name: Build accounts
- run: yarn build:accounts
-
- - name: Publish accounts
- uses: cloudflare/pages-action@1
- with:
- accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
- apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
- projectName: ente
- branch: deploy/accounts
- directory: web/apps/accounts/out
- wranglerVersion: "3"
diff --git a/.github/workflows/web-deploy-auth.yml b/.github/workflows/web-deploy-auth.yml
deleted file mode 100644
index d195b62f8c..0000000000
--- a/.github/workflows/web-deploy-auth.yml
+++ /dev/null
@@ -1,43 +0,0 @@
-name: "Deploy (auth)"
-
-on:
- push:
- # Run workflow on pushes to the deploy/auth
- branches: [deploy/auth]
-
-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"
- cache-dependency-path: "web/yarn.lock"
-
- - name: Install dependencies
- run: yarn install
-
- - name: Build auth
- run: yarn build:auth
-
- - name: Publish auth
- uses: cloudflare/pages-action@1
- with:
- accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
- apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
- projectName: ente
- branch: deploy/auth
- directory: web/apps/auth/out
- wranglerVersion: "3"
diff --git a/.github/workflows/web-deploy-cast.yml b/.github/workflows/web-deploy-cast.yml
deleted file mode 100644
index 01e17486d0..0000000000
--- a/.github/workflows/web-deploy-cast.yml
+++ /dev/null
@@ -1,43 +0,0 @@
-name: "Deploy (cast)"
-
-on:
- push:
- # Run workflow on pushes to the deploy/cast
- branches: [deploy/cast, deploy-f/cast]
-
-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"
- cache-dependency-path: "web/yarn.lock"
-
- - name: Install dependencies
- run: yarn install
-
- - name: Build cast
- run: yarn build:cast
-
- - name: Publish cast
- uses: cloudflare/pages-action@1
- with:
- accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
- apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
- projectName: ente
- branch: deploy/cast
- directory: web/apps/cast/out
- wranglerVersion: "3"
diff --git a/.github/workflows/web-deploy-photos.yml b/.github/workflows/web-deploy-one.yml
similarity index 59%
rename from .github/workflows/web-deploy-photos.yml
rename to .github/workflows/web-deploy-one.yml
index cb3a9db86d..bdf1773aec 100644
--- a/.github/workflows/web-deploy-photos.yml
+++ b/.github/workflows/web-deploy-one.yml
@@ -1,9 +1,19 @@
-name: "Deploy (photos)"
+name: "Deploy one (web)"
on:
- push:
- # Run workflow on pushes to the deploy/photos
- branches: [deploy/photos]
+ workflow_dispatch:
+ inputs:
+ app:
+ description: "App to build and deploy"
+ type: choice
+ required: true
+ default: "photos"
+ options:
+ - "accounts"
+ - "auth"
+ - "cast"
+ - "payments"
+ - "photos"
jobs:
deploy:
@@ -29,15 +39,15 @@ jobs:
- name: Install dependencies
run: yarn install
- - name: Build photos
- run: yarn build:photos
+ - name: Build ${{ inputs.app }}
+ run: yarn build:${{ inputs.app }}
- - name: Publish photos
+ - name: Publish ${{ inputs.app }} to preview
uses: cloudflare/pages-action@1
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
projectName: ente
- branch: deploy/photos
- directory: web/apps/photos/out
+ branch: deploy/${{ inputs.app }}
+ directory: web/apps/${{ inputs.app }}/out
wranglerVersion: "3"
diff --git a/.github/workflows/web-deploy-payments.yml b/.github/workflows/web-deploy-payments.yml
deleted file mode 100644
index 367e1db186..0000000000
--- a/.github/workflows/web-deploy-payments.yml
+++ /dev/null
@@ -1,43 +0,0 @@
-name: "Deploy (payments)"
-
-on:
- push:
- # Run workflow on pushes to the deploy/payments
- branches: [deploy/payments]
-
-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"
- cache-dependency-path: "web/yarn.lock"
-
- - name: Install dependencies
- run: yarn install
-
- - name: Build payments
- run: yarn build:payments
-
- - name: Publish payments
- uses: cloudflare/pages-action@1
- with:
- accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
- apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
- projectName: ente
- branch: deploy/payments
- directory: web/apps/payments/dist
- wranglerVersion: "3"
diff --git a/.github/workflows/web-preview.yml b/.github/workflows/web-deploy-preview.yml
similarity index 98%
rename from .github/workflows/web-preview.yml
rename to .github/workflows/web-deploy-preview.yml
index 8f39c02474..4cf5986de7 100644
--- a/.github/workflows/web-preview.yml
+++ b/.github/workflows/web-deploy-preview.yml
@@ -1,4 +1,4 @@
-name: "Preview (web)"
+name: "Deploy preview (web)"
on:
workflow_dispatch:
diff --git a/.github/workflows/web-nightly.yml b/.github/workflows/web-deploy-staging.yml
similarity index 86%
rename from .github/workflows/web-nightly.yml
rename to .github/workflows/web-deploy-staging.yml
index 9497382924..93469a65d0 100644
--- a/.github/workflows/web-nightly.yml
+++ b/.github/workflows/web-deploy-staging.yml
@@ -1,17 +1,11 @@
-name: "Nightly (web)"
+name: "Deploy staging (web)"
on:
schedule:
- # [Note: Run workflow every 24 hours]
+ # Run everyday at ~3:00 PM IST
#
- # Run every 24 hours - First field is minute, second is hour of the day
- # This runs 23:15 UTC everyday - 1 and 15 are just arbitrary offset to
- # avoid scheduling it on the exact hour, as suggested by GitHub.
- #
- # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
- # https://crontab.guru/
- #
- - cron: "15 23 * * *"
+ # See: [Note: Run workflow every 24 hours]
+ - cron: "25 9 * * *"
# Also allow manually running the workflow
workflow_dispatch:
@@ -39,6 +33,21 @@ jobs:
- name: Install dependencies
run: yarn install
+ - name: Build photos
+ run: yarn build:photos
+ env:
+ NEXT_PUBLIC_ENTE_ALBUMS_ENDPOINT: https://albums.ente.sh
+
+ - name: Publish photos
+ uses: cloudflare/pages-action@1
+ with:
+ accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
+ apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
+ projectName: ente
+ branch: n-photos
+ directory: web/apps/photos/out
+ wranglerVersion: "3"
+
- name: Build accounts
run: yarn build:accounts
@@ -90,18 +99,3 @@ jobs:
branch: n-payments
directory: web/apps/payments/dist
wranglerVersion: "3"
-
- - name: Build photos
- run: yarn build:photos
- env:
- NEXT_PUBLIC_ENTE_ALBUMS_ENDPOINT: https://albums.ente.sh
-
- - name: Publish photos
- uses: cloudflare/pages-action@1
- with:
- accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
- apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
- projectName: ente
- branch: n-photos
- directory: web/apps/photos/out
- wranglerVersion: "3"
diff --git a/.github/workflows/web-deploy.yml b/.github/workflows/web-deploy.yml
new file mode 100644
index 0000000000..7f3ea8fe34
--- /dev/null
+++ b/.github/workflows/web-deploy.yml
@@ -0,0 +1,109 @@
+name: "Deploy (photos)"
+
+on:
+ schedule:
+ # [Note: Run workflow every 24 hours]
+ #
+ # 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).
+ #
+ # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
+ # https://crontab.guru/
+ #
+ - cron: "25 2 * * 1-6"
+ # 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"
+ cache-dependency-path: "web/yarn.lock"
+
+ - name: Install dependencies
+ run: yarn install
+
+ - name: Build photos
+ run: yarn build:photos
+
+ - name: Publish photos
+ uses: cloudflare/pages-action@1
+ with:
+ accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
+ apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
+ projectName: ente
+ branch: deploy/photos
+ directory: web/apps/photos/out
+ wranglerVersion: "3"
+
+ - name: Build accounts
+ run: yarn build:accounts
+
+ - name: Publish accounts
+ uses: cloudflare/pages-action@1
+ with:
+ accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
+ apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
+ projectName: ente
+ branch: deploy/accounts
+ directory: web/apps/accounts/out
+ wranglerVersion: "3"
+
+ - name: Build auth
+ run: yarn build:auth
+
+ - name: Publish auth
+ uses: cloudflare/pages-action@1
+ with:
+ accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
+ apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
+ projectName: ente
+ branch: deploy/auth
+ directory: web/apps/auth/out
+ wranglerVersion: "3"
+
+ - name: Build cast
+ run: yarn build:cast
+
+ - name: Publish cast
+ uses: cloudflare/pages-action@1
+ with:
+ accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
+ apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
+ projectName: ente
+ branch: deploy/cast
+ directory: web/apps/cast/out
+ wranglerVersion: "3"
+
+ - name: Build payments
+ run: yarn build:payments
+
+ - name: Publish payments
+ uses: cloudflare/pages-action@1
+ with:
+ accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
+ apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
+ projectName: ente
+ branch: deploy/payments
+ directory: web/apps/payments/dist
+ wranglerVersion: "3"
diff --git a/.github/workflows/web-lint.yml b/.github/workflows/web-lint.yml
index baf2a98ab0..7f5d270029 100644
--- a/.github/workflows/web-lint.yml
+++ b/.github/workflows/web-lint.yml
@@ -3,7 +3,7 @@ name: "Lint (web)"
on:
# Run on every push to a branch other than main that changes web/
push:
- branches-ignore: [main, "deploy/**", "deploy-f/**"]
+ branches-ignore: [main]
paths:
- "web/**"
- ".github/workflows/web-lint.yml"