Skip to content

Commit

Permalink
Only deploy website when "website/**" has changed (#1352)
Browse files Browse the repository at this point in the history
This PR adds the "path" property to the website CD pipeline.

Although our website depends on the `lib/` folder, I think it's better
to not always deploy a new version if only `lib/` changed and not
`website/` to reduce the deployments (every deployment makes the cache
invalid). It's very likely that in this case, nothing important changed
on the website. In case it was important, you can always trigger a
manual deployment.
  • Loading branch information
nilsreichardt authored Mar 3, 2024
1 parent dd8ccf9 commit 6c57364
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/website_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,38 @@ on:
push:
branches:
- main
paths:
# We only build and deploy a new version, when a user relevant files
# changed.
- "website/**"
# We trigger also this workflow, if this workflow is changed, so that new
# changes will be applied.
- ".github/workflows/website_cd.yml"
# The following paths are excluded from the above paths. It's important to
# list the paths at the end of the file, so that the exclude paths are
# applied.
#
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-including-and-excluding-paths.
- "!**/*.md"
- "!**/*.mdx"
- "!**/*.gitignore"
# The macOS version is only used for debugging.
- "!website/macos/**"
# Test files are not relevant for the website deployment.
- "!**/test/**"
- "!**/test_driver/**"
- "!**/integration_test/**"
- "!**/analysis_options.yaml"
- "!**/dart_test.yaml"

# Allows you to run this workflow manually from the Actions tab.
#
# Since the website depends on the /lib folder, it could be that the website
# requires a new deployment. In this case, the developer needs to trigger the
# deployment manually or wait until the next change "website/**" is pushed. We
# do this to avoid unnecessary deployments since a new deployment invalidates
# the cache.
workflow_dispatch:

# Set permissions to none.
#
Expand Down

0 comments on commit 6c57364

Please sign in to comment.