Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Sahil Gautam committed Nov 11, 2024
0 parents commit f5f8dbc
Show file tree
Hide file tree
Showing 8 changed files with 1,351 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: '.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
Binary file added FiraSans-Regular.ttf
Binary file not shown.
Binary file added IosevkaNerdFont-Regular.ttf
Binary file not shown.
60 changes: 60 additions & 0 deletions dotfiles
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/env bash

function init_archlinux() {
# install basic system packages
sudo pacman --noconfirm -Syu ansible python-watchdog neovim openssh git
}

function init_voidlinux() {
# copy the mirror file
sudo cp /usr/share/xbps.d/00-repository-main.conf /etc/xbps.d/00-repository-main.conf

# install the required packages
sudo xbps-install -Syu git openssl ansible python3-watchdog neovim
}

function init() {
# check for distro in /etc/os-release file
case $(cat /etc/os-release | grep -e "^NAME" | awk -F "=" '{gsub(/"/, "", $2); print $2}') in
"Arch Linux") init_archlinux;;
"Void") init_voidlinux;;
*) echo "distro not supported" && exit ;;
esac
}

function clone_dotfiles() {
mkdir -p $HOME/repos && cd $HOME/repos
[ ! -d "$HOME/repos/dotfiles" ] && git clone https://gitlab.com/printfdebugging/dotfiles.git $HOME/repos/dotfiles
cd $HOME/repos/dotfiles
}

function run_ansible_tasks_with_tag() {
if ! command -v ansible-playbook; then
init
fi

# setup dotfiles repository
clone_dotfiles

# run the ansible-playbook command
ansible-playbook main.yml \
--tags "${@}" \
--become --ask-become-pass \
--ask-vault-pass
}

function run_ansible_save_task() {
# Run ansible-playbook with the save tag
clone_dotfiles
ansible-playbook main.yml \
--tags "${@}"
}


case "$1" in
"init") init;;
"full"|"") run_ansible_tasks_with_tag include,files,packages,system;;
"save-"*) run_ansible_save_task ${@};;
*) run_ansible_tasks_with_tag include,${@};;
esac

Loading

0 comments on commit f5f8dbc

Please sign in to comment.