Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions: Automatically fill in blog post date after merge #166

Merged
merged 4 commits into from
Dec 13, 2020

Conversation

Holzhaus
Copy link
Member

@Holzhaus Holzhaus commented Dec 10, 2020

After merging a new blog post into the website branch, this automatically updates the blog post date to the commit date of the merge commit if the filename starts with XXXX-XX-XX- or 2020-XX-XX. It renames the file and updates the date: entry, then commits and pushes the changes automatically.

Afterwards, it automatically triggers a redeploy on Netlify if the NETLIFY_BUILD_HOOK secret is defined: https://docs.netlify.com/configure-builds/build-hooks/
(git pushes from GitHub don't trigger web hooks automatically to prevent endless loops)

Therefore, we don't have to keep up with bumping the dates manually all the time.

@Holzhaus
Copy link
Member Author

If you want to test this on your fork:

Merge this branch into the website branch, then push the website branch to your fork. If you have a Netlify page for your fork, generate a build hook URL and add it to your repository's secrets (Repository Settings -> Secrets).

Then open a Pull Request against the website branch of your fork that adds a new blog post with filename XXXX-XX-XX-somename.html or 2020-XX-XX-somename.html. For example, you can just use my serato blogpost branch: #81

Then merge the PR on your fork. Github actions should automatically update the date, commit and push. If you've confogured the NETLIFY_BUILD_HOOK secret, a Netlify deploy will be triggered automatically.

@Holzhaus
Copy link
Member Author

@daschuer Please add the build hook secret to this repo.

@Holzhaus
Copy link
Member Author

Merge? Then I can update #167 with the necessary changes.

@Be-ing Be-ing merged commit c487fe0 into mixxxdj:website Dec 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants