Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Only deploy if HEAD is different from what's currently deployed #3655

Closed
robdodson opened this issue Aug 7, 2020 · 3 comments · Fixed by #5137
Closed

Only deploy if HEAD is different from what's currently deployed #3655

robdodson opened this issue Aug 7, 2020 · 3 comments · Fixed by #5137
Assignees
Labels
accepted **Should be used by Eng team only**: Use this to tell the stalebot to keep a bug or PR open. feature request New feature or request

Comments

@robdodson
Copy link
Contributor

Is your feature request related to a problem? Please describe.
We recently switched to deploying the site hourly. This is great, but it also means we're often deploying the same version of the site.

Describe the solution you'd like
We should only deploy if HEAD is different from the current live site.

Pete mentioned that on webfu they used a git-head.txt file to compare versions. I think the only downside to that approach is needing to check the git-head.txt file into source control with every PR.

Other options:

  • Write the version to a meta tag on the homepage and fetch the homepage to do the comparison during a build. Pete pointed out that this would mean invalidating the homepage whenever any other part of the site changes, which could cause our service worker to throw out the cached file.
  • Have Eleventy generate a file that is git ignored that contains the version number and gets served by the server at https://web.dev/version.json. Then compare HEAD to that file.
  • Use GitHub Action's artifacts feature to upload the version to GitHub. When an Action runs it can fetch the artifact and compare it against HEAD to see if it needs to deploy.
@robdodson robdodson added the feature request New feature or request label Aug 7, 2020
@robdodson
Copy link
Contributor Author

robdodson commented Aug 7, 2020

cc @GoogleChrome/web-dev-eng

@robdodson robdodson added the accepted **Should be used by Eng team only**: Use this to tell the stalebot to keep a bug or PR open. label Aug 10, 2020
@samthor
Copy link
Contributor

samthor commented Aug 27, 2020

Another possibility: use the HEAD value as the version deployed to App Engine. We can check if that version is already deployed and skip if so.

@robdodson
Copy link
Contributor Author

Hm... i wonder how this would work in a Firebase world...

I wonder if we should create a version.txt file or something as part of the deploy and dump the info there and sneak it into the firebase deploy. Then we'd fetch that file to check?

@robdodson robdodson self-assigned this Jan 21, 2021
@robdodson robdodson removed their assignment Apr 6, 2021
@robdodson robdodson added this to Proposed in Engineering 🕹 via automation Apr 6, 2021
@MichaelSolati MichaelSolati self-assigned this Apr 6, 2021
Engineering 🕹 automation moved this from Proposed to Done Apr 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted **Should be used by Eng team only**: Use this to tell the stalebot to keep a bug or PR open. feature request New feature or request
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants