2020-11-03 09:53:56 +00:00
|
|
|
name: "Publish"
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches: master
|
2021-01-23 09:47:27 +00:00
|
|
|
schedule:
|
|
|
|
- cron: "0 0 * * *" # daily
|
2020-11-03 09:53:56 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
deploy:
|
|
|
|
runs-on: ubuntu-20.04 # change to -latest when possible
|
|
|
|
|
|
|
|
steps:
|
2021-01-23 09:31:41 +00:00
|
|
|
- uses: purcell/setup-emacs@master
|
|
|
|
with:
|
|
|
|
version: 27.1
|
2020-11-03 09:53:56 +00:00
|
|
|
|
2021-01-23 09:31:41 +00:00
|
|
|
- name: Checkout config
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
2020-11-03 09:53:56 +00:00
|
|
|
|
2021-01-23 09:31:41 +00:00
|
|
|
- name: Symlink config to expected location
|
|
|
|
# I could just set DOOMDIR ... but this is also easy
|
|
|
|
run: |
|
|
|
|
mkdir -p ~/.config
|
|
|
|
ln -s $GITHUB_WORKSPACE ~/.config/doom
|
|
|
|
mkdir -p ~/.org/roam
|
2020-11-03 09:53:56 +00:00
|
|
|
|
2021-01-23 09:31:41 +00:00
|
|
|
- name: Generate init.el et. al from config.org
|
|
|
|
run: |
|
|
|
|
cd ~/.config/doom
|
|
|
|
emacs --batch --eval "(require 'org)" --eval '(org-babel-tangle-file "config.org")'
|
2020-11-03 09:53:56 +00:00
|
|
|
|
2021-01-23 09:31:41 +00:00
|
|
|
- name: Clone Doom to ~/.emacs.d
|
|
|
|
run: git clone --depth 1 https://github.com/hlissner/doom-emacs ~/.emacs.d
|
2020-11-03 09:53:56 +00:00
|
|
|
|
2021-01-23 09:31:41 +00:00
|
|
|
- name: Get Doom's version
|
|
|
|
id: doom-version
|
|
|
|
run: |
|
|
|
|
cd ~/.emacs.d
|
|
|
|
echo ::set-output name=hash::$(git log -1 | head -1 | awk '{print substr($2,1,7)}')
|
|
|
|
shell: bash
|
2020-11-03 09:53:56 +00:00
|
|
|
|
2021-01-23 09:31:41 +00:00
|
|
|
- name: Cache Doom's install
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/.emacs.d
|
|
|
|
key: ${{ runner.os }}-doom@${{ steps.doom-version.outputs.hash }}
|
2020-11-03 09:53:56 +00:00
|
|
|
|
2021-01-23 09:31:41 +00:00
|
|
|
- name: Doom dependencies
|
|
|
|
run: sudo apt-get install git ripgrep xclip
|
2020-11-03 09:53:56 +00:00
|
|
|
|
2021-01-23 09:31:41 +00:00
|
|
|
- name: Install Doom
|
|
|
|
run: ~/.emacs.d/bin/doom install --no-env --no-fonts
|
2020-11-03 09:53:56 +00:00
|
|
|
|
2021-01-23 09:31:41 +00:00
|
|
|
- name: Export config
|
2021-01-23 12:14:39 +00:00
|
|
|
run: ~/.config/doom/misc/config-publishing/publish.sh
|
2021-01-23 09:31:41 +00:00
|
|
|
|
2021-01-25 02:19:59 +00:00
|
|
|
# - name: Debug failure over SSH (tmate)
|
|
|
|
# if: ${{ failure() }}
|
|
|
|
# uses: mxschmitt/action-tmate@v3.1
|
|
|
|
|
2021-01-23 09:31:41 +00:00
|
|
|
- name: Deploy
|
2021-01-23 09:32:27 +00:00
|
|
|
if: ${{ github.event_name != 'pull_request'}}
|
2021-01-23 09:31:41 +00:00
|
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
|
|
with:
|
|
|
|
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
|
|
|
publish_dir: ./publish
|
|
|
|
force_orphan: true
|