├── webflowgit.yml ├── .github └── workflows │ └── main.yml ├── LICENSE └── README.md /webflowgit.yml: -------------------------------------------------------------------------------- 1 | # site: https://www.example.com 2 | # pages: false 3 | # OR 4 | # pages: 5 | # ignore: 6 | # - /posts/** 7 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: webflow-git 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | force: 7 | description: ignore timestamp and force update 8 | required: false 9 | default: '' 10 | schedule: 11 | - cron: '40 * * * *' 12 | 13 | jobs: 14 | track: 15 | name: Track Webflow site changes 16 | 17 | runs-on: ubuntu-latest 18 | 19 | steps: 20 | - name: Checkout 21 | uses: actions/checkout@v2 22 | 23 | - name: Process Webflow Site 24 | uses: loomchild/webflow-get@v1 25 | 26 | - name: Commit and Push 27 | uses: EndBug/add-and-commit@v7 28 | with: 29 | author_name: Webflow Git 30 | author_email: webflowgit@local 31 | message: 'Site updated' 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Jarek Lipski 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Webflow Git 2 | 3 | > A utility to track changes to a Webflow site on GitHub. 4 | 5 | ## Introduction 6 | 7 | Webflow Git is a simple utility used to monitor and track changes to a Webflow site on GitHub. Both style and content changes are detected and every change is stored as a GitHub commit. 8 | 9 | The utility is simple to set up because it doesn't require access to your Webflow account and all customization can be done via the GitHub web interface. 10 | 11 | ## Installation 12 | 13 | 1. Log-in or create a GitHub account. 14 | 15 | 2. Click the "Use this template" button above the code to generate a new repository based on this template repository: 16 | 17 | ![Use this template](https://user-images.githubusercontent.com/2506014/134331253-501c4947-e66a-4066-b939-9a48ff001d60.png) 18 | 19 | 3. Name your new repository the same as your Webflow site domain (e.g. www.example.com). Alternatively, you can choose any repository name and specify the site domain in the [configuration file](#configuration): 20 | 21 | ![Repository name](https://user-images.githubusercontent.com/2506014/134332104-ee3c654d-6481-465f-b791-56a7dd2c50ca.png) 22 | 23 | ## Configuration 24 | 25 | You can customize Webflow Git by editing the [webflowgit.yml](./webflowgit.yml) configuration file. To achieve this, open the file contents and click on the Pen icon: 26 | 27 | ![Edit configuration](https://user-images.githubusercontent.com/2506014/134331242-fd3da739-705c-4e18-9f37-b6db6398c6ef.png) 28 | 29 | Make sure to test your changes by [triggering the check manually](#manual-trigger). 30 | 31 | ### site 32 | 33 | Specify URL of the site to be monitored, including the protocol, e.g.: 34 | 35 | ``` 36 | site: https://www.example.com 37 | ``` 38 | 39 | Disable tracking completely: 40 | 41 | ``` 42 | site: false 43 | ``` 44 | 45 | By default, the site domain is the same as your repository name. 46 | 47 | ### pages 48 | 49 | Do not track changes in pages content (track style changes only): 50 | 51 | ``` 52 | pages: false 53 | ``` 54 | 55 | Ignore changes in some pages (for example CMS-generated pages, like blog posts or product pages). This setting uses [glob syntax](https://github.com/micromatch/picomatch#globbing-features): 56 | 57 | ``` 58 | pages: 59 | ignore: 60 | - /posts/** 61 | ``` 62 | 63 | By default, all pages are tracked. 64 | 65 | ## How it works 66 | 67 | The utility works by visiting your site at regular intervals and downloading, formatting and comparing the code to the previous revision. If any difference is detected, a new revision is committed to the repository. 68 | 69 | ### Check frequency 70 | 71 | Your site is checked for updates every hour. 72 | 73 | > Advanced: this can be customized by updating the cron schedule in the [workflow configuration file](./.github/workflows/main.yml). 74 | 75 | ### Manual trigger 76 | 77 | You can launch the check manually. To achieve this, click the Actions link on the menu below your project name, then select `webflow-git` workflow and finally click on the "Run workflow" button: 78 | 79 | ![Trigger manually](https://user-images.githubusercontent.com/2506014/134331249-c2e64b87-3d8d-4dbd-b1d9-46352fd5d3bd.png) 80 | 81 | ## Epilogue 82 | 83 | This project was created out of frustration with random regressions in Webflow projects. Although there's a built-in backup functionality, it's time-consuming to find out at which point something has broken down, and then, due to the lack of diff functionality, it's very difficult to understand the nature of the modification that caused the regression. The problem becomes even more severe if multiple people develop the same project. 84 | 85 | Some parts of this tool are inspired by an excellent [Upptime](https://upptime.js.org/) site monitor, most notably using the GitHub Template and configuration management. 86 | 87 | webflowgitbyloomchild 88 | --------------------------------------------------------------------------------