Skip to content

Building dotfiles with GitHub Actions #2951

Closed Answered by bytebone
bytebone asked this question in Q&A
Discussion options

You must be logged in to vote

I've played around with this a bit more and managed to come up with a fully working solution, checking all the boxes. Should anyone come across this, admittedly edgecase, scenario, I'll publish my solution here:

The workflow file, placed in .github/workflows/ on your chezmoi repo, looks like this:

name: Publish theme to public repo
on:
  workflow_dispatch:
  push:
    branches:
      - main

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3
        with:
          path: 'repo'

      - name: Build dotfiles
        run: sh repo/.build/build.sh
      
      - name: Push to public repo
        uses: cpina/[email protected]

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by bytebone
Comment options

You must be logged in to vote
2 replies
@bytebone
Comment options

@Lockszmith-GH
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants