Skip to content

Commit

Permalink
[web] Switch to (almost) continuous deployments (#1677)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnvr authored May 10, 2024
2 parents 32e8a44 + 938cecf commit db86bec
Show file tree
Hide file tree
Showing 16 changed files with 188 additions and 254 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/auth-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/desktop-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,8 @@ jobs:
run: yarn build

- name: Publish
uses: cloudflare/pages-action@1
uses: cloudflare/wrangler-action@v3
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
projectName: ente
branch: help
directory: docs/docs/.vitepress/dist
wranglerVersion: "3"
command: pages deploy --project-name=ente --branch=help docs/docs/.vitepress/dist
2 changes: 1 addition & 1 deletion .github/workflows/docs-verify-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mobile-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/server-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
43 changes: 0 additions & 43 deletions .github/workflows/web-deploy-accounts.yml

This file was deleted.

43 changes: 0 additions & 43 deletions .github/workflows/web-deploy-auth.yml

This file was deleted.

43 changes: 0 additions & 43 deletions .github/workflows/web-deploy-cast.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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"
43 changes: 0 additions & 43 deletions .github/workflows/web-deploy-payments.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Preview (web)"
name: "Deploy preview (web)"

on:
workflow_dispatch:
Expand Down
Original file line number Diff line number Diff line change
@@ -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:

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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"
Loading

0 comments on commit db86bec

Please sign in to comment.