From 6ed97444d9f0a84e8dc1cfcdd6d8088b0c2aefa7 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Sun, 25 Feb 2024 23:51:24 +0000 Subject: [PATCH] adds a compile workflow --- .editorconfig | 3 +++ .github/workflows/compile_dotfiles.yml | 33 ++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 .editorconfig create mode 100644 .github/workflows/compile_dotfiles.yml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..e57157e --- /dev/null +++ b/.editorconfig @@ -0,0 +1,3 @@ +[*.yml] +indent_style = space +indent_size = 2 \ No newline at end of file diff --git a/.github/workflows/compile_dotfiles.yml b/.github/workflows/compile_dotfiles.yml new file mode 100644 index 0000000..52b473a --- /dev/null +++ b/.github/workflows/compile_dotfiles.yml @@ -0,0 +1,33 @@ +name: "Compile Dotfiles" +on: + pull_request: + branches: + - main + +jobs: + compile_dotfiles: + name: Compile Dotfles + runs-on: macos-latest + steps: + - name: Install Chezmoi + run: sh -c "$(curl -fsLS get.chezmoi.io)" + + - name: Initialise Dotfiles + run: chezmoi init harryob + + - name: Output Dotfiles + run: mkdir /output && chezmoi apply --destination /output + + - name: Checkout Output Branch + uses: actions/checkout@v3 + with: + ref: compiled + + - name: Move Output and Commit + run: | + mv /output/* . + git config user.name github-actions + git config user.email github-actions@github.com + git add . + git commit -m "compiled dotfiles" + git push \ No newline at end of file