Skip to content

Commit

Permalink
chore: update doc deploys + others
Browse files Browse the repository at this point in the history
  • Loading branch information
kiliantyler committed Sep 5, 2024
1 parent e07607c commit fdeeac3
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 20 deletions.
17 changes: 13 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,20 @@
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm",
"features": {
"ghcr.io/mpriscella/features/sops:1": {},
"ghcr.io/eitsupi/devcontainer-features/go-task:1": {},
"ghcr.io/astronomer/devcontainer-features/astro-cli:1": {},
"ghcr.io/mpriscella/features/sops:1": {
"version": "latest"
},
"ghcr.io/eitsupi/devcontainer-features/go-task:1": {
"version": "latest"
},
"ghcr.io/astronomer/devcontainer-features/astro-cli:1": {
"version": "latest"
},
"ghcr.io/trunk-io/devcontainer-feature/trunk:1": {},
"ghcr.io/itsmechlark/features/1password:1": {}
"ghcr.io/itsmechlark/features/1password:1": {
"version": "latest"
},
"ghcr.io/michidk/devcontainers-features/bun:1": {}
}

// Use 'forwardPorts' to make a list of ports inside the container available locally.
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/docs-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
push:
branches:
- main
paths:
- 'docs/**'

jobs:
build:
Expand All @@ -17,22 +19,20 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: ./docs/package-lock.json

- name: Setup Bun
uses: oven-sh/setup-bun@v2

- name: Install dependencies
run: npm ci
run: bun install

- name: Build website
run: npm run build
run: bun run build

- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/build
path: docs/dist

deploy:
name: Deploy to GitHub Pages
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/docs-test-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
pull_request:
branches:
- main
paths:
- 'docs/**'

jobs:
test-deploy:
Expand All @@ -19,13 +21,11 @@ jobs:
with:
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
- name: Setup Bun
uses: oven-sh/setup-bun@v2

- name: Install dependencies
run: npm ci
run: bun install

- name: Test build website
run: npm run build
run: bun run build
2 changes: 1 addition & 1 deletion .trunk/configs/.yamllint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ rules:
trailing-spaces: enable
truthy:
level: warning
allowed-values: ["true", "false", "on"]
allowed-values: ["true", "false", "on", "off", "yes", "no"]
61 changes: 61 additions & 0 deletions docs/public/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/usr/bin/env zsh

# -----------------------------------
# author: @kiliantyler
# title: Dotfiles Installation Script
# description: Installs Xcode Command Line Tools if they are not already installed,
# then installs Chezmoi and initializes it with my dotfiles.
# -----------------------------------

fail() {
echo "$1" >&2
exit 1
}

# -----------------------------------
# Ensure we are running in zsh
# Make this check POSIX compliant
# -----------------------------------

if [ -z "${ZSH_VERSION:-}" ]; then
fail "Please run this script in zsh"
fi

should_install_command_line_tools() {
! [[ -e "/Library/Developer/CommandLineTools/usr/bin/git" ]]
}

chomp() {
printf "%s" "${1/"$'\n'"/}"
}

# -----------------------------------
# Xcode Command Line Tools Installation
# -----------------------------------

if should_install_command_line_tools; then
echo "Installing Xcode Command Line Tools"
# This temporary file prompts the 'softwareupdate' utility to list the Command Line Tools
clt_placeholder="/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress"
command sudo touch "${clt_placeholder}"

clt_label_command="/usr/sbin/softwareupdate -l |
grep -B 1 -E 'Command Line Tools' |
awk -F'*' '/^ *\\*/ {print \$2}' |
sed -e 's/^ *Label: //' -e 's/^ *//' |
sort -V |
tail -n1"
clt_label="$(chomp "$(/bin/bash -c "${clt_label_command}")")"

if [[ -n ${clt_label} ]]; then
command sudo "/usr/sbin/softwareupdate" "-i" "${clt_label}"
command sudo "/usr/bin/xcode-select" "--switch" "/Library/Developer/CommandLineTools"
fi
command sudo "/bin/rm" "-f" "${clt_placeholder}"
fi

# -----------------------------------
# Chezmoi Installation and Initialization
# -----------------------------------

sh -c "$(curl -fsLS get.chezmoi.io)" -- -b $HOME/.local/bin init --apply kiliantyler
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

if [ ! -f "${HOME}/.config/chezmoi/key.txt" ]; then
mkdir -p "${HOME}/.config/chezmoi"
chezmoi age decrypt --output "${HOME}/.config/chezmoi/key.txt" --passphrase "{{ .chezmoi.sourceDir }}/key.txt.age"
$HOME/.local/bin/chezmoi age decrypt --output "${HOME}/.config/chezmoi/key.txt" --passphrase "{{ .chezmoi.sourceDir }}/key.txt.age"
chmod 600 "${HOME}/.config/chezmoi/key.txt"
fi

0 comments on commit fdeeac3

Please sign in to comment.