Skip to content

Commit

Permalink
Push Emacs configuration to web site repository on changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bkhl committed Oct 6, 2024
1 parent 0215b72 commit 0758726
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .emacs.d/configuration.org
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Inspirations for this Emacs configuration include:
- [[https://emacscast.org/][EmacsCast]].
- Protesilaos Stavrou's [[https://protesilaos.com/codelog/][blog]] and [[https://www.youtube.com/channel/UC0uTPqBCFIpZxlz_Lv1tk_g][videos]].

Some interesting properties of this configuration:
These are some interesting properties of this configuration:

- Almost all of the configuration is kept in an Org file.
- The startup time is quite fast. There are some tweaks in [[https://github.com/bkhl/dotfiles/blob/main/.emacs.d/init.el][init.el]] and [[https://github.com/bkhl/dotfiles/blob/main/.emacs.d/early-init.el][early-init.el]] that makes helps with this, together with prudent use of autoloading, and in general trying to keep the number of add-on packages low.
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: Publish Emacs configuration

on:
push:
branches:
- main

jobs:
build:
name: Publish Emacs configuration
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
path: dotfiles

- name: Check out home page repository
uses: actions/checkout@v4
with:
repository: bkhl/elektrubadur.se
token: "${{ secrets.ELEKTRUBADUR_SE_TOKEN }}"
path: elektrubadur.se
ref: main
fetch-depth: 0

- name: Commit and push changes
run: |
set -xeuo pipefail
install -v -m 0644 -T
dotfiles/.emacs.d/configuration.org
elektrubadur.se/content/emacs-configuration.org
# Get Git commiter and commit message
pushd dotfiles
git config --global user.name "$(git log -1 --pretty='%an')"
git config --global user.email "$(git log -1 --pretty='%ae')"
message="$(git log -1 --pretty='%B')"
popd
# Commit and push changes
pushd elektrubadur.se
git add --all
if git diff --quiet HEAD --; then
# No changes
exit 0
fi
git commit --message="${message}"
git push origin main:main

0 comments on commit 0758726

Please sign in to comment.