diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b08dda22..2f7bf713 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,8 +18,75 @@ jobs: name: Build Jekyll runs-on: ubuntu-latest steps: - - name: Checkout + - name: Checkout theme uses: actions/checkout@v4 + with: + repository: LizardByte/LizardByte.github.io + ref: ${{ github.repository == 'LizardByte/LizardByte.github.io' && github.ref || 'master' }} + submodules: recursive + path: theme + + - name: Checkout project + if: ${{ github.repository != 'LizardByte/LizardByte.github.io' }} + uses: actions/checkout@v4 + with: + path: project + + - name: Setup project + if: ${{ github.repository == 'LizardByte/LizardByte.github.io' }} + run: | + mkdir -p ./project + cp -RT ./theme/ ./project/ + rm -rf ./project/third-party + + - name: Create site + env: + TMPDIR: /home/runner/work/tmp + run: | + mkdir -p ${TMPDIR} + + base_dirs=( + ./theme/third-party/beautiful-jekyll + ./theme + ) + + targets=( + *.gemspec + _data + _includes + _layouts + _sass + assets + 404.html + _config.yml + favicon.ico + feed.xml + Gemfile + staticman.yml + tags.html + ) + + for base_dir in "${base_dirs[@]}"; do + for target in "${targets[@]}"; do + if [ -e "$base_dir/$target" ]; then + cp -rf "$base_dir/$target" ${TMPDIR}/ + fi + done + done + + # copy project directory, they should only come from the project repo + cp -RTf ./project/ ${TMPDIR}/ + + # remove the workspace + cd .. + rm -rf ${GITHUB_WORKSPACE} + + # move the temporary directory to the workspace + mv ${TMPDIR} ${GITHUB_WORKSPACE} + cd ${GITHUB_WORKSPACE} + + # debug contents recursively + ls -Ra - name: Setup Ruby uses: ruby/setup-ruby@v1 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..157caccb --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "third-party/beautiful-jekyll"] + path = third-party/beautiful-jekyll + url = https://github.com/daattali/beautiful-jekyll.git + branch = master diff --git a/_config.yml b/_config.yml index 2e6649b7..5bf377a3 100644 --- a/_config.yml +++ b/_config.yml @@ -11,9 +11,8 @@ ############################ # https://beautifuljekyll.com/getstarted/#method-1-github-repository-with-remote_theme -# remote_theme: daattali/beautiful-jekyll@6.0.1 -remote_theme: daattali/beautiful-jekyll@b1b667e372acf5f602cca6fee64dd850af70f3da -# TODO: move to LizardByte fork, with customizations specific to our site +# remote_theme: daattali/beautiful-jekyll +# Our custom workflow will handle setting up the theme. E.g. combining beautifuljekyll with our customizations. # Name of website title: LizardByte diff --git a/third-party/beautiful-jekyll b/third-party/beautiful-jekyll new file mode 160000 index 00000000..b1b667e3 --- /dev/null +++ b/third-party/beautiful-jekyll @@ -0,0 +1 @@ +Subproject commit b1b667e372acf5f602cca6fee64dd850af70f3da