Skip to content

Commit

Permalink
[web] Migrate off deprecated cf action (#1679)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnvr authored May 10, 2024
2 parents aedb655 + 811e56f commit 6a4b86d
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 77 deletions.
13 changes: 1 addition & 12 deletions .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,4 @@ jobs:
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
# [Note: Wrangler commit-dirty]
#
# Without the --commit-dirty flag, running the wrangler-action
# always prints a warning when used:
#
# Warning: Your working directory is a git repo and has uncommitted changes
# To silence this warning, pass in --commit-dirty=true
#
# There is no clear documentation of if passing this is
# harmless, but all indications and in-practice tests seem to
# indicate so.
command: pages deploy --project-name=ente --branch=help --commit-dirty=true docs/docs/.vitepress/dist
command: pages deploy --project-name=ente --commit-dirty=true --branch=help docs/docs/.vitepress/dist
18 changes: 13 additions & 5 deletions .github/workflows/web-deploy-one.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,19 @@ jobs:
run: yarn build:${{ inputs.app }}

- name: Publish ${{ inputs.app }} to preview
uses: cloudflare/pages-action@1
uses: cloudflare/wrangler-action@v3
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
projectName: ente
branch: deploy/${{ inputs.app }}
directory: web/apps/${{ inputs.app }}/out
wranglerVersion: "3"
# [Note: Wrangler commit-dirty]
#
# Without the --commit-dirty flag, running the wrangler-action
# always prints a warning when used:
#
# Warning: Your working directory is a git repo and has uncommitted changes
# To silence this warning, pass in --commit-dirty=true
#
# There is no clear documentation of if passing this is
# harmless, but all indications and in-practice tests seem to
# indicate so.
command: pages deploy --project-name=ente --commit-dirty=true --branch=deploy/${{ inputs.app }} web/apps/${{ inputs.app }}/out
7 changes: 2 additions & 5 deletions .github/workflows/web-deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,8 @@ jobs:
run: yarn build:${{ inputs.app }}

- name: Publish ${{ inputs.app }} to preview
uses: cloudflare/pages-action@1
uses: cloudflare/wrangler-action@v3
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
projectName: ente
branch: preview
directory: web/apps/${{ inputs.app }}/out
wranglerVersion: "3"
command: pages deploy --project-name=ente --commit-dirty=true --branch=preview web/apps/${{ inputs.app }}/out
7 changes: 2 additions & 5 deletions .github/workflows/web-deploy-staff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,8 @@ jobs:
run: yarn build:staff

- name: Publish staff
uses: cloudflare/pages-action@1
uses: cloudflare/wrangler-action@v3
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
projectName: ente
branch: deploy/staff
directory: web/apps/staff/dist
wranglerVersion: "3"
command: pages deploy --project-name=ente --commit-dirty=true --branch=deploy/staff web/apps/staff/dist
35 changes: 10 additions & 25 deletions .github/workflows/web-deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,63 +39,48 @@ jobs:
NEXT_PUBLIC_ENTE_ALBUMS_ENDPOINT: https://albums.ente.sh

- name: Publish photos
uses: cloudflare/pages-action@1
uses: cloudflare/wrangler-action@v3
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
projectName: ente
branch: n-photos
directory: web/apps/photos/out
wranglerVersion: "3"
command: pages deploy --project-name=ente --commit-dirty=true --branch=n-photos web/apps/photos/out

- name: Build accounts
run: yarn build:accounts

- name: Publish accounts
uses: cloudflare/pages-action@1
uses: cloudflare/wrangler-action@v3
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
projectName: ente
branch: n-accounts
directory: web/apps/accounts/out
wranglerVersion: "3"
command: pages deploy --project-name=ente --commit-dirty=true --branch=n-accounts web/apps/accounts/out

- name: Build auth
run: yarn build:auth

- name: Publish auth
uses: cloudflare/pages-action@1
uses: cloudflare/wrangler-action@v3
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
projectName: ente
branch: n-auth
directory: web/apps/auth/out
wranglerVersion: "3"
command: pages deploy --project-name=ente --commit-dirty=true --branch=n-auth web/apps/auth/out

- name: Build cast
run: yarn build:cast

- name: Publish cast
uses: cloudflare/pages-action@1
uses: cloudflare/wrangler-action@v3
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
projectName: ente
branch: n-cast
directory: web/apps/cast/out
wranglerVersion: "3"
command: pages deploy --project-name=ente --commit-dirty=true --branch=n-cast web/apps/cast/out

- name: Build payments
run: yarn build:payments

- name: Publish payments
uses: cloudflare/pages-action@1
uses: cloudflare/wrangler-action@v3
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
projectName: ente
branch: n-payments
directory: web/apps/payments/dist
wranglerVersion: "3"
command: pages deploy --project-name=ente --commit-dirty=true --branch=n-payments web/apps/payments/dist
35 changes: 10 additions & 25 deletions .github/workflows/web-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,63 +47,48 @@ jobs:
run: yarn build:photos

- name: Publish photos
uses: cloudflare/pages-action@1
uses: cloudflare/wrangler-action@v3
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
projectName: ente
branch: deploy/photos
directory: web/apps/photos/out
wranglerVersion: "3"
command: pages deploy --project-name=ente --commit-dirty=true --branch=deploy/photos web/apps/photos/out

- name: Build accounts
run: yarn build:accounts

- name: Publish accounts
uses: cloudflare/pages-action@1
uses: cloudflare/wrangler-action@v3
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
projectName: ente
branch: deploy/accounts
directory: web/apps/accounts/out
wranglerVersion: "3"
command: pages deploy --project-name=ente --commit-dirty=true --branch=deploy/accounts web/apps/accounts/out

- name: Build auth
run: yarn build:auth

- name: Publish auth
uses: cloudflare/pages-action@1
uses: cloudflare/wrangler-action@v3
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
projectName: ente
branch: deploy/auth
directory: web/apps/auth/out
wranglerVersion: "3"
command: pages deploy --project-name=ente --commit-dirty=true --branch=deploy/auth web/apps/auth/out

- name: Build cast
run: yarn build:cast

- name: Publish cast
uses: cloudflare/pages-action@1
uses: cloudflare/wrangler-action@v3
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
projectName: ente
branch: deploy/cast
directory: web/apps/cast/out
wranglerVersion: "3"
command: pages deploy --project-name=ente --commit-dirty=true --branch=deploy/cast web/apps/cast/out

- name: Build payments
run: yarn build:payments

- name: Publish payments
uses: cloudflare/pages-action@1
uses: cloudflare/wrangler-action@v3
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
projectName: ente
branch: deploy/payments
directory: web/apps/payments/dist
wranglerVersion: "3"
command: pages deploy --project-name=ente --commit-dirty=true --branch=deploy/payments web/apps/payments/dist

0 comments on commit 6a4b86d

Please sign in to comment.