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

generator #960

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

generator #960

wants to merge 1 commit into from

Conversation

abernier
Copy link
Contributor

@abernier abernier commented Jul 10, 2024

depends on: #958

This PR adds a "reusable workflow" that any new {repo} can re-"use" as a generator(think Jekyll), eg:

on:
  push:
    branches: main

jobs:
  build:
    uses: timlrx/tailwind-nextjs-starter-blog/.github/workflows/action.yml@v2

...

The repo can override any file from timlrx/tailwind-nextjs-starter-blog, especially data/blog/ folder.

-> A working example: abernier/myblog

Copy link

vercel bot commented Jul 10, 2024

@abernier is attempting to deploy a commit to the timlrx's projects Team on Vercel.

A member of the Team first needs to authorize it.

@abernier abernier marked this pull request as draft July 10, 2024 08:23
@timlrx
Copy link
Owner

timlrx commented Jul 10, 2024

This is too smart 😄

Now I really feel like creating a documentation template that expands on this concept. I think we should automatically disable the newsletter box since it is the only feature in the static site that cannot actually be used.

Another consideration is maintenance - I don't want to break everyone's blog with an update. Having the deployable github pages is a start, but I can't guarantee that the settings and data are always backwards compatible, not to mention certain dependencies with breaking changes. Perhaps we should pin this to a version and let the user manually update it, instead of using main?

@abernier
Copy link
Contributor Author

abernier commented Jul 10, 2024

Another consideration is maintenance - I don't want to break everyone's blog with an update. Having the deployable github pages is a start, but I can't guarantee that the settings and data are always backwards compatible, not to mention certain dependencies with breaking changes. Perhaps we should pin this to a version and let the user manually update it, instead of using main?

For this, I've set a ref input, that defaults to @v2 so the checkouted timlrx/tailwind-nextjs-starter-blog version is v2 as of now this current @v2 version.

workflow_call:
inputs:
repo:
type: string
required: false
default: 'timlrx/tailwind-nextjs-starter-blog'
ref:
type: string
required: false
default: 'v2'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: ${{ inputs.repo }}
ref: ${{ inputs.ref }}

so:

jobs:
  build:
    uses: timlrx/tailwind-nextjs-starter-blog/.github/workflows/action.yml@v2

is equivalent to:

jobs:
  build:
    uses: timlrx/tailwind-nextjs-starter-blog/.github/workflows/action.yml@v2
    with:
      ref: v2

=> actions/checkout will checkout v2 branch before rsync:

- uses: actions/checkout@v4
with:
repository: ${{ inputs.repo }}
ref: ${{ inputs.ref }}

@abernier
Copy link
Contributor Author

abernier commented Jul 11, 2024

finally, now that we have gh-page workflow, I'm not so sure it's a good idea compared to a simple fork, that stays "syncable"...

image

@timlrx
Copy link
Owner

timlrx commented Jul 13, 2024

finally, now that we have gh-page workflow, I'm not so sure it's a good idea compared to a simple fork, that stays "syncable"...

I think it's a interesting feature, probably more suited for someone who just wants to use the default config with minimal changes. Though if you are using a next.js blog, you are probably looking to customize it.

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