Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ jobs:
name: build-output
path: dist/backoffice/browser

# Vercel reads vercel.json from the pushed commit. Build branches
# hold only the built files, so add one that turns off deployments.
- name: Turn off Vercel deployments for the build branch
run: |
echo '{ "git": { "deploymentEnabled": false } }' > dist/backoffice/browser/vercel.json

- name: Deploy the application
uses: MrYuion/git-publish-subdir-action@develop
env:
Expand Down Expand Up @@ -171,6 +177,12 @@ jobs:
name: build-output
path: dist/backoffice/browser

# Vercel reads vercel.json from the pushed commit. Build branches
# hold only the built files, so add one that turns off deployments.
- name: Turn off Vercel deployments for the build branch
run: |
echo '{ "git": { "deploymentEnabled": false } }' > dist/backoffice/browser/vercel.json

- name: Deploy the application
uses: MrYuion/git-publish-subdir-action@develop
env:
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/demo-site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Updates backoffice.demo.place.tech once per day.
# Vercel deploys only the backoffice-demo branch (see vercel.json). This workflow
# moves that branch to develop when develop changed since the last run.
name: 'Demo Site'

on:
schedule:
- cron: '0 17 * * *' # daily at 17:00 UTC (3–4 am Sydney)
workflow_dispatch: # manual run: updates now if develop changed

permissions:
contents: write

concurrency:
group: demo-site
cancel-in-progress: false

jobs:
update_demo_site:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v6
with:
ref: develop

- name: Move backoffice-demo to develop
shell: bash
run: |
develop="$(git rev-parse HEAD)"
current="$(git ls-remote origin refs/heads/backoffice-demo | cut -f1)"
if [[ "${current}" == "${develop}" ]]; then
echo "backoffice-demo is already at develop (${develop})."
exit 0
fi
# The lease makes the push fail if backoffice-demo moved after the check.
git push --force-with-lease="refs/heads/backoffice-demo:${current}" \
origin "HEAD:refs/heads/backoffice-demo"
echo "Moved backoffice-demo from ${current:-nothing} to ${develop}."
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ uses hash-based routing and enables its service worker only in production.
Backoffice sends errors to Sentry. See [`docs/sentry.md`](docs/sentry.md) to
set the DSN for a domain and to set up source map uploads.

## Demo site

The `backoffice` Vercel project serves [backoffice.demo.place.tech](https://backoffice.demo.place.tech/). Vercel deploys only the `backoffice-demo` branch. The Vercel team can create a limited number of deployments each day, and Vercel counts failed and canceled deployments too. Thus, other branches must not create Vercel deployments:

- `vercel.json` turns off Vercel deployments for all branches except `backoffice-demo`.
- The `BUILD` workflow adds a `vercel.json` that turns off Vercel deployments to each `build/*` branch commit. Vercel reads `vercel.json` from the pushed commit, and build branches do not contain the root file.

The `Demo Site` workflow moves `backoffice-demo` to `develop` once per day (17:00 UTC), if `develop` changed. To update the site now, run the workflow manually. Do not push to `backoffice-demo` directly.

## Stack

- Angular 22 and Angular Material
Expand Down
9 changes: 9 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://openapi.vercel.sh/vercel.json",
"git": {
"deploymentEnabled": {
"**": false,
"backoffice-demo": true
}
}
}
Loading