Skip to content

Commit 6e9b4ec

Browse files
feat(build): use jekyll and restyle website
1 parent 9471c7a commit 6e9b4ec

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1592
-1579
lines changed

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# ignore hidden files
2+
.*
3+
4+
_site/

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# ensure dockerfiles are checked out with LF line endings
2+
Dockerfile text eol=lf
3+
*.dockerfile text eol=lf

.github/workflows/build.yml

Lines changed: 57 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,59 @@ on:
99
branches: [master]
1010
workflow_dispatch:
1111

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
1216
jobs:
13-
update:
17+
build:
18+
name: Build Jekyll
1419
runs-on: ubuntu-latest
15-
1620
steps:
1721
- name: Checkout
1822
uses: actions/checkout@v4
1923

24+
- name: Setup Ruby
25+
uses: ruby/setup-ruby@v1
26+
with:
27+
ruby-version: '3.3'
28+
29+
- name: Install dependencies
30+
run: |
31+
bundle install
32+
33+
- name: Setup Pages
34+
id: configure-pages
35+
uses: actions/configure-pages@v5
36+
37+
- name: Setup CI config
38+
run: |
39+
echo "---" > _config_ci.yml
40+
echo "baseurl: ${{ steps.configure-pages.outputs.base_path }}" >> _config_ci.yml
41+
42+
- name: Build site
43+
env:
44+
JEKYLL_ENV: production
45+
PAGES_REPO_NWO: ${{ github.repository }}
46+
run: |
47+
bundle exec jekyll build --future --config _config_ci.yml,_config.yml
48+
49+
- name: Upload artifact
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: site
53+
path: _site
54+
if-no-files-found: error
55+
retention-days: 1
56+
57+
deploy:
58+
name: Deploy to Pages
59+
if: >-
60+
(github.event_name == 'push' && github.ref == 'refs/heads/master') ||
61+
(github.event_name == 'workflow_dispatch')
62+
runs-on: ubuntu-latest
63+
needs: build
64+
steps:
2065
- name: Checkout gh-pages
2166
uses: actions/checkout@v4
2267
with:
@@ -25,39 +70,22 @@ jobs:
2570
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of the personal token
2671
fetch-depth: 0 # otherwise, will fail to push refs to dest repo
2772

28-
- name: Get current date
29-
id: date
30-
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
31-
32-
- name: Build website
73+
- name: Clean
3374
run: |
34-
# install npm dependencies
35-
npm install
36-
3775
# empty contents of gh-pages
3876
rm -f -r ./gh-pages/*
3977
40-
# move contents of dist to gh-pages
41-
# https://stackoverflow.com/a/20192079/11214013
42-
cp -r ./dist/. ./gh-pages/
43-
44-
# move node_modules directory to gh-pages
45-
mv -f ./node_modules/ ./gh-pages/
46-
47-
- name: Upload Artifacts
48-
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
49-
uses: actions/upload-artifact@v4
78+
- name: Download artifact
79+
uses: actions/download-artifact@v4
5080
with:
51-
name: gh-pages
52-
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
53-
path: |
54-
${{ github.workspace }}/gh-pages
55-
!**/*.git
81+
name: site
82+
path: gh-pages
83+
84+
- name: no-jekyll
85+
run: |
86+
touch gh-pages/.nojekyll
5687
5788
- name: Deploy to gh-pages
58-
if: >-
59-
(github.event_name == 'push' && github.ref == 'refs/heads/master') ||
60-
(github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
6189
uses: actions-js/[email protected]
6290
with:
6391
github_token: ${{ secrets.GH_BOT_TOKEN }}
@@ -66,4 +94,4 @@ jobs:
6694
directory: gh-pages
6795
branch: gh-pages
6896
force: false
69-
message: automatic-update-${{ steps.date.outputs.date }}
97+
message: "Deploy site from ${{ github.sha }}"

.github/workflows/rss-monitor.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Monitor RSS feed
3+
4+
on:
5+
schedule:
6+
- cron: "0 * * * *" # hourly
7+
8+
jobs:
9+
rss-monitor:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: RSS to issues
13+
uses: git-for-windows/rss-to-issues@v0
14+
with:
15+
github-token: ${{ secrets.GH_BOT_TOKEN }}
16+
feed: https://lizardbyte.github.io/feed.xml
17+
character-limit: 0
18+
dry-run: false
19+
max-age: 48h
20+
labels: blog

.github/workflows/rss-notifier.yml

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
---
2+
name: RSS Notifier
3+
4+
on:
5+
issues:
6+
types: [opened]
7+
8+
jobs:
9+
authorize:
10+
runs-on: ubuntu-latest
11+
outputs:
12+
authorized: ${{ steps.authorize.outputs.result }}
13+
steps:
14+
- name: Authorize
15+
id: authorize
16+
uses: actions/github-script@v7
17+
with:
18+
github-token: ${{ secrets.GH_BOT_TOKEN }}
19+
result-encoding: string
20+
script: |
21+
// get issue
22+
const issue = await github.rest.issues.get({
23+
owner: context.repo.owner,
24+
repo: context.repo.repo,
25+
issue_number: context.issue.number
26+
});
27+
28+
// get author
29+
const author = issue.data.user.login;
30+
31+
// check if author is LizardByte-bot
32+
if (author === 'LizardByte-bot') {
33+
console.log('Author is LizardByte-bot');
34+
} else {
35+
console.log('Author is not LizardByte-bot');
36+
return 'false';
37+
}
38+
39+
// check if label is blog
40+
const labels = issue.data.labels.map(label => label.name);
41+
if (labels.includes('blog')) {
42+
console.log('Label is blog');
43+
} else {
44+
console.log('Label is not blog');
45+
return 'false';
46+
}
47+
48+
return 'true';
49+
50+
discord:
51+
if: needs.authorize.outputs.authorized == 'true'
52+
needs: authorize
53+
outputs:
54+
post-url: "https://discord.com/channels/804382334370578482/804383203020374016"
55+
runs-on: ubuntu-latest
56+
steps:
57+
- name: discord
58+
uses: sarisia/actions-status-discord@v1
59+
with:
60+
avatar_url: ${{ secrets.ORG_LOGO_URL }}
61+
color: 0x00ff00
62+
nodetail: true
63+
nofail: false
64+
title: ${{ github.event.issue.title }}
65+
url: ${{ github.event.issue.body }}
66+
username: ${{ secrets.DISCORD_USERNAME }}
67+
webhook: ${{ secrets.DISCORD_ANNOUNCEMENT_WEBHOOK }}
68+
69+
fb_group:
70+
if: false && needs.authorize.outputs.authorized == 'true'
71+
needs: authorize
72+
outputs:
73+
post-url: "https://www.facebook.com/groups/lizardbyte"
74+
runs-on: ubuntu-latest
75+
steps:
76+
- name: facebook-post-action
77+
uses: ReenigneArcher/facebook-post-action@v1
78+
with:
79+
page_id: ${{ secrets.FACEBOOK_GROUP_ID }}
80+
access_token: ${{ secrets.FACEBOOK_ACCESS_TOKEN }}
81+
message: ${{ github.event.issue.title }}
82+
url: ${{ github.event.issue.body }}
83+
84+
fb_page:
85+
if: needs.authorize.outputs.authorized == 'true'
86+
needs: authorize
87+
outputs:
88+
post-url: "https://www.facebook.com/LizardByteDev"
89+
runs-on: ubuntu-latest
90+
steps:
91+
- name: facebook-post-action
92+
uses: ReenigneArcher/facebook-post-action@v1
93+
with:
94+
page_id: ${{ secrets.FACEBOOK_PAGE_ID }}
95+
access_token: ${{ secrets.FACEBOOK_ACCESS_TOKEN }}
96+
message: ${{ github.event.issue.title }}
97+
url: ${{ github.event.issue.body }}
98+
99+
reddit:
100+
if: needs.authorize.outputs.authorized == 'true'
101+
needs: authorize
102+
outputs:
103+
post-url: ${{ steps.post.outputs.postUrl }}
104+
runs-on: ubuntu-latest
105+
steps:
106+
- name: reddit
107+
id: post
108+
uses: bluwy/release-for-reddit-action@v2
109+
with:
110+
username: ${{ secrets.REDDIT_USERNAME }}
111+
password: ${{ secrets.REDDIT_PASSWORD }}
112+
app-id: ${{ secrets.REDDIT_CLIENT_ID }}
113+
app-secret: ${{ secrets.REDDIT_CLIENT_SECRET }}
114+
subreddit: ${{ secrets.REDDIT_SUBREDDIT }}
115+
title: ${{ github.event.issue.title }}
116+
url: ${{ github.event.issue.body }}
117+
flair-id: ${{ secrets.REDDIT_FLAIR_ID }} # https://www.reddit.com/r/<subreddit>>/api/link_flair.json
118+
119+
x:
120+
if: needs.authorize.outputs.authorized == 'true'
121+
needs: authorize
122+
outputs:
123+
post-url: "https://x.com/LizardByteDev"
124+
runs-on: ubuntu-latest
125+
steps:
126+
- name: x
127+
uses: nearform-actions/github-action-notify-twitter@v1
128+
# alternative: noweh/[email protected]
129+
with:
130+
message: "${{ github.event.issue.title }}: ${{ github.event.issue.body }}"
131+
twitter-app-key: ${{ secrets.X_APP_KEY }}
132+
twitter-app-secret: ${{ secrets.X_APP_SECRET }}
133+
twitter-access-token: ${{ secrets.X_ACCESS_TOKEN }}
134+
twitter-access-token-secret: ${{ secrets.X_ACCESS_TOKEN_SECRET }}
135+
136+
close-issue:
137+
if: always()
138+
needs:
139+
- authorize
140+
- discord
141+
- facebook_group
142+
- facebook_page
143+
- reddit
144+
- x
145+
runs-on: ubuntu-latest
146+
steps:
147+
- name: Close issue
148+
env:
149+
GH_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
150+
run: |
151+
comment="| Job | Status | Post URL |\n"
152+
comment+="| --- | ------ | -------- |\n"
153+
comment+="| Authorize | ${{ needs.authorize.result }} | |\n"
154+
comment+="| Discord | ${{ needs.discord.result }} | ${{ needs.discord.outputs.post-url }} |\n"
155+
# comment+="| Facebook Group | ${{ needs.fb_group.result }} | ${{ needs.fb_group.outputs.post-url }} |\n"
156+
comment+="| Facebook Page | ${{ needs.fb_page.result }} | ${{ needs.fb_page.outputs.post-url }} |\n"
157+
comment+="| Reddit | ${{ needs.reddit.result }} | ${{ needs.reddit.outputs.post-url }} |\n"
158+
comment+="| X | ${{ needs.x.result }} | ${{ needs.x.outputs.post-url }} |\n"
159+
160+
close_reason="completed"
161+
lock_reason="resolved"
162+
163+
gh issue close ${{ github.event.issue.number }} --comment "${comment}" --reason "${close_reason}"
164+
gh issue lock ${{ github.event.issue.number }} --reason "${lock_reason}"

.gitignore

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
# ignore JetBrains project
22
.idea/
33

4-
# ignore node modules
5-
node_modules/
6-
package-lock.json
7-
8-
# ignore duplicated dist folder for localization
9-
dist/en
10-
dist/es-ES
4+
_site/

.run/Dockerfile.run.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="Dockerfile" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
3+
<deployment type="dockerfile">
4+
<settings>
5+
<option name="containerName" value="LizardByte-site" />
6+
<option name="portBindings">
7+
<list>
8+
<DockerPortBindingImpl>
9+
<option name="containerPort" value="4000" />
10+
<option name="hostPort" value="4000" />
11+
</DockerPortBindingImpl>
12+
</list>
13+
</option>
14+
<option name="commandLineOptions" value="--net=host" />
15+
<option name="sourceFilePath" value="Dockerfile" />
16+
</settings>
17+
</deployment>
18+
<method v="2" />
19+
</configuration>
20+
</component>

404.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: 404 - Page not found
3+
layout: default
4+
permalink: /404.html
5+
---
6+
7+
<div class="text-center">
8+
<h1>Whoops, this page doesn't exist.</h1>
9+
<h1>Move along. (404 error)</h1>
10+
<br/>
11+
12+
<img src="{{ 'assets/img/404-southpark.jpg' | relative_url }}" alt="Not found" />
13+
</div>

CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
app.lizardbyte.dev

0 commit comments

Comments
 (0)