Skip to content

Commit

Permalink
feat(build): use jekyll and restyle website
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher committed Sep 27, 2024
1 parent dfccc6c commit 730d8fa
Show file tree
Hide file tree
Showing 67 changed files with 1,402 additions and 1,578 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# ignore hidden files
.*

_site/
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# ensure dockerfiles are checked out with LF line endings
Dockerfile text eol=lf
*.dockerfile text eol=lf
85 changes: 57 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,59 @@ on:
branches: [master]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
update:
build:
name: Build Jekyll
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'

- name: Install dependencies
run: |
bundle install
- name: Setup Pages
id: configure-pages
uses: actions/configure-pages@v5

- name: Setup CI config
run: |
echo "---" > _config_ci.yml
echo "baseurl: ${{ steps.configure-pages.outputs.base_path }}" >> _config_ci.yml
- name: Build site
env:
JEKYLL_ENV: production
PAGES_REPO_NWO: ${{ github.repository }}
run: |
bundle exec jekyll build --future --config _config_ci.yml,_config.yml
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: site
path: _site
if-no-files-found: error
retention-days: 1

deploy:
name: Deploy to Pages
if: >-
(github.event_name == 'push' && github.ref == 'refs/heads/master') ||
(github.event_name == 'workflow_dispatch')
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout gh-pages
uses: actions/checkout@v4
with:
Expand All @@ -25,38 +70,22 @@ jobs:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of the personal token
fetch-depth: 0 # otherwise, will fail to push refs to dest repo

- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT

- name: Build website
- name: Clean
run: |
# install npm dependencies
npm install
# empty contents of gh-pages
rm -f -r ./gh-pages/*
# move contents of dist to gh-pages
mv -f ./dist/* ./gh-pages/
# move node_modules directory to gh-pages
mv -f ./node_modules/ ./gh-pages/
- name: Upload Artifacts
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
uses: actions/upload-artifact@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: gh-pages
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
path: |
${{ github.workspace }}/gh-pages
!**/*.git
name: site
path: gh-pages

- name: no-jekyll
run: |
touch gh-pages/.nojekyll
- name: Deploy to gh-pages
if: >-
(github.event_name == 'push' && github.ref == 'refs/heads/master') ||
(github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
uses: actions-js/[email protected]
with:
github_token: ${{ secrets.GH_BOT_TOKEN }}
Expand All @@ -65,4 +94,4 @@ jobs:
directory: gh-pages
branch: gh-pages
force: false
message: automatic-update-${{ steps.date.outputs.date }}
message: "Deploy site from ${{ github.sha }}"
8 changes: 1 addition & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
# ignore JetBrains project
.idea/

# ignore node modules
node_modules/
package-lock.json

# ignore duplicated dist folder for localization
dist/en
dist/es-ES
_site/
20 changes: 20 additions & 0 deletions .run/Dockerfile.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Dockerfile" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="containerName" value="LizardByte-site" />
<option name="portBindings">
<list>
<DockerPortBindingImpl>
<option name="containerPort" value="4000" />
<option name="hostPort" value="4000" />
</DockerPortBindingImpl>
</list>
</option>
<option name="commandLineOptions" value="--net=host" />
<option name="sourceFilePath" value="Dockerfile" />
</settings>
</deployment>
<method v="2" />
</configuration>
</component>
13 changes: 13 additions & 0 deletions 404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: 404 - Page not found
layout: default
permalink: /404.html
---

<div class="text-center">
<h1>Whoops, this page doesn't exist.</h1>
<h1>Move along. (404 error)</h1>
<br/>

<img src="{{ 'assets/img/404-southpark.jpg' | relative_url }}" alt="Not found" />
</div>
1 change: 1 addition & 0 deletions CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
app.lizardbyte.dev
32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM ruby:3.3-bookworm

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN <<_DEPS
#!/bin/bash
set -e

apt-get update -qq
apt-get install -y --no-install-recommends \
build-essential
apt-get clean
rm -rf /var/lib/apt/lists/*
_DEPS

WORKDIR /app

COPY . .

# Install the gems specified in the Gemfile
RUN <<_SETUP
#!/bin/bash
set -e

bundle install
_SETUP

# Expose the port that Jekyll will run on
EXPOSE 4000

# Command to build and serve the Jekyll site
CMD ["bundle", "exec", "jekyll", "serve", "--trace", "--config", "_config.yml,_config_local.yml"]
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source 'https://rubygems.org'
gem 'jekyll'
gem 'github-pages', group: :jekyll_plugins
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Overview

## About

This repo contains the source files for the [LizardByte](https://app.lizardbyte.dev) website.

The page is built using jekyll and hosted on GitHub Pages.

## Integrations

[![GitHub Workflow Status (Build)](https://img.shields.io/github/actions/workflow/status/lizardbyte/lizardbyte.github.io/build.yml.svg?branch=master&label=build&logo=github&style=for-the-badge)](https://github.com/LizardByte/LizardByte.github.io/actions/workflows/build.yml?query=branch%3Amaster)

### CrowdIn Localization

[![CrowdIn graph](https://app.lizardbyte.dev/dashboard/crowdin/LizardByte_graph.svg)](https://translate.lizardbyte.dev)
19 changes: 0 additions & 19 deletions README.rst

This file was deleted.

Loading

0 comments on commit 730d8fa

Please sign in to comment.