-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (43 loc) · 1.54 KB
/
install.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
name: Install
on: [push]
jobs:
ubuntu:
runs-on: ubuntu-latest
container: ubuntu:latest
steps:
- name: Install required packages
run: apt update && apt upgrade -y && apt install -y git
- name: Install dotfiles
run: |
git clone --bare https://github.com/y011d4/dotfiles.git $HOME/.dotfiles.git
alias dotfiles="git --git-dir=$HOME/.dotfiles.git --work-tree=$HOME"
dotfiles config status.showuntrackedfiles no
dotfiles checkout
# if some files are conflicted, make backup and then checkout
if [ $? -ne 0 ]; then
for i in $(dotfiles checkout 2>&1 | head -n -2 | awk 'NR>1{print $1}'); do
mv $i $i.bk
done
dotfiles checkout
fi
arch:
runs-on: ubuntu-latest
container: archlinux:latest
steps:
- name: Update packages
run: pacman -Syu --noconfirm
- name: Install required packages
run: pacman -S --noconfirm git
- name: Install dotfiles
run: |
git clone --bare https://github.com/y011d4/dotfiles.git $HOME/.dotfiles.git
alias dotfiles="git --git-dir=$HOME/.dotfiles.git --work-tree=$HOME"
dotfiles config status.showuntrackedfiles no
dotfiles checkout
# if some files are conflicted, make backup and then checkout
if [ $? -ne 0 ]; then
for i in $(dotfiles checkout 2>&1 | head -n -2 | awk 'NR>1{print $1}'); do
mv $i $i.bk
done
dotfiles checkout
fi