Files
zenbones-theme/.github/workflows/build.yml
Michael Chris Lopez eb3556099c chore: add CI workflow
2021-10-29 15:26:56 +08:00

48 lines
1.4 KiB
YAML

name: Build
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Clone lush
run: git clone --depth 1 https://github.com/rktjmp/lush.nvim ~/.local/share/nvim/site/pack/zenbones/start/lush.nvim
- uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: stable
- name: Setup git
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
printf 'BUILD_BRANCH=bot/build/%s\n' ${GITHUB_REF#refs/heads/} >> $GITHUB_ENV
- name: Checkout to build branch
run: git checkout -b ${BUILD_BRANCH}
- name: Run builder script
run: make
- name: Create PR
run: |
if ! [[ -z $(git status -s) ]]; then
git add autoload/lightline/colorscheme/ colors/ lua/lualine/ extras/
git commit -m "chore: rebuild artifacts"
git push --force https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} ${BUILD_BRANCH}
gh pr create --fill --base ${GITHUB_REF#refs/heads/} --head ${BUILD_BRANCH} || true
fi