Skip to content

Commit 096feac

Browse files
authored
Feat: Devcontainer with Jekyll + Compiler theme (#1)
2 parents d541650 + 39905f5 commit 096feac

16 files changed

+570
-3
lines changed

.devcontainer/Dockerfile

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM python:3.12
2+
3+
ENV PYTHONDONTWRITEBYTECODE=1 \
4+
PYTHONUNBUFFERED=1 \
5+
USER=compiler
6+
7+
RUN useradd --create-home --shell /bin/bash $USER && \
8+
chown -R $USER /home/$USER
9+
10+
WORKDIR /home/$USER/site
11+
12+
RUN apt-get update
13+
RUN apt-get install -y ruby-full && gem install bundler
14+
RUN python -m pip install --upgrade pip
15+
COPY Gemfile Gemfile
16+
#COPY Gemfile.lock Gemfile.lock
17+
RUN bundle install
18+
19+
COPY .devcontainer/requirements.txt .devcontainer/requirements.txt
20+
RUN pip install --no-cache-dir -r .devcontainer/requirements.txt
21+
22+
USER $USER
23+
ENV PATH "$PATH:/home/$USER/.local/bin"

.devcontainer/devcontainer.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.183.0/containers/jekyll
3+
{
4+
"name": "compilerla/compilerla.github.io",
5+
"dockerComposeFile": "../compose.yml",
6+
"service": "site",
7+
"workspaceFolder": "/home/compiler/site",
8+
"postAttachCommand": ["/bin/bash", ".devcontainer/postAttach.sh"],
9+
"customizations": {
10+
"vscode": {
11+
"settings": {
12+
"terminal.integrated.defaultProfile.linux": "bash",
13+
"terminal.integrated.profiles.linux": {
14+
"bash": {
15+
"path": "/bin/bash"
16+
}
17+
}
18+
},
19+
"extensions": [
20+
"eamodio.gitlens",
21+
"esbenp.prettier-vscode",
22+
"mhutchie.git-graph",
23+
"redhat.vscode-xml",
24+
"sissel.shopify-liquid"
25+
]
26+
}
27+
}
28+
}

.devcontainer/postAttach.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
set -eu
3+
4+
git config --global --add safe.directory /home/compiler/site
5+
6+
# initialize hook environments
7+
pre-commit install --install-hooks --overwrite

.devcontainer/requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pre-commit

.github/workflows/site-preview.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Deploy Preview to Netlify
3333
run: |
3434
netlify deploy \
35-
--alias="${GITHUB_REPOSITORY#*/}-${{ github.event.number }}" \
35+
--alias="compiler-docs-${{ github.event.number }}" \
3636
--auth=${{ secrets.NETLIFY_AUTH_TOKEN }} \
3737
--dir="_site" \
3838
--site=${{ vars.NETLIFY_PREVIEW_APP_SITE_ID }}
@@ -56,5 +56,5 @@ jobs:
5656
issue_number: context.issue.number,
5757
owner: context.repo.owner,
5858
repo: context.repo.repo,
59-
body: `Preview url: https://${context.repo.repo}-${{ github.event.number }}--${hostnameSuffix}`,
59+
body: `Preview url: https://compiler-docs-${{ github.event.number }}--${hostnameSuffix}`,
6060
})

.pre-commit-config.yaml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
ci:
2+
autofix_commit_msg: "chore(pre-commit): autofix run"
3+
autoupdate_commit_msg: "chore(pre-commit): autoupdate hooks"
4+
5+
default_install_hook_types:
6+
- pre-commit
7+
- commit-msg
8+
9+
repos:
10+
- repo: https://github.com/compilerla/conventional-pre-commit
11+
rev: v3.6.0
12+
hooks:
13+
- id: conventional-pre-commit
14+
stages: [commit-msg]
15+
16+
- repo: https://github.com/pre-commit/pre-commit-hooks
17+
rev: v5.0.0
18+
hooks:
19+
- id: trailing-whitespace
20+
- id: mixed-line-ending
21+
- id: end-of-file-fixer
22+
- id: requirements-txt-fixer
23+
- id: check-yaml
24+
args: ["--unsafe"]
25+
- id: check-added-large-files

.prettierrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"tabWidth": 2,
3+
"useTabs": false,
4+
"printWidth": 130
5+
}

.vscode/settings.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"editor.defaultFormatter": "esbenp.prettier-vscode",
4+
"files.encoding": "utf8",
5+
"files.eol": "\n",
6+
"files.insertFinalNewline": true,
7+
"files.trimFinalNewlines": true,
8+
"files.trimTrailingWhitespace": true,
9+
"editor.tabSize": 2,
10+
"files.associations": {
11+
"*.html": "liquid"
12+
},
13+
"[liquid]": {
14+
"editor.formatOnSave": true
15+
}
16+
}

.vscode/tasks.json

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "Jekyll: Build Dev",
8+
"detail": "jekyll serve --force_polling --livereload",
9+
"type": "shell",
10+
"linux": {
11+
"command": "bundle exec jekyll serve --force_polling --livereload"
12+
},
13+
"group": {
14+
"kind": "build",
15+
"isDefault": true
16+
},
17+
"presentation": {
18+
"echo": true,
19+
"reveal": "always",
20+
"focus": false,
21+
"panel": "shared",
22+
"showReuseMessage": true,
23+
"clear": false
24+
}
25+
}
26+
]
27+
}

Gemfile

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
source 'https://rubygems.org'
2+
3+
gem "github-pages", "~> 232", group: :jekyll_plugins

0 commit comments

Comments
 (0)