-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (45 loc) · 1.33 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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