name: dotfiles
on: push

jobs:
  osx:
    runs-on: macos-latest
    steps:
      - name: Cancel Previous Runs
        uses: styfle/cancel-workflow-action@0.4.1
        with:
          access_token: ${{ github.token }}
      - uses: actions/checkout@v2.3.2
      - name: Cache homebrew packages
        uses: actions/cache@v2
        env:
          cache-name: cache-installed-packages
        with:
          path: |
            $HOME/Library/Caches/Homebrew
            /Library/Caches/Homebrew
            $HOME/.pyenv
          key: homebrew-${{ runner.os }}
          restore-keys: |
            homebrew-${{ runner.os }}
      - name: Upgrade homebrew
        run: cd "$(brew --repo)" && git fetch && git reset --hard origin/master && brew update
      - name: Remove problematic 2to3 bin
        run: rm /usr/local/bin/2to3
      - name: Run install.sh
        run: ./install.sh

name: dotfiles
on: push

jobs:
  archlinux:
    runs-on: ubuntu-latest
    steps:
      - name: Cancel Previous Runs
        uses: styfle/cancel-workflow-action@0.4.1
        with:
          access_token: ${{ github.token }}
      - uses: actions/checkout@v2
      - name: Pull docker image
        run: docker-compose pull

      - name: Run installer on Archlinux
        run: docker-compose up --build --exit-code-from dotfiles

      - name: Push to GitHub Packages
        uses: docker/build-push-action@v1
        with:
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}
          registry: docker.pkg.github.com
          repository: benmezger/dotfiles/arch-dotfiles
          tag_with_ref: true
  osx:
    runs-on: macos-latest
    steps:
      - name: Cancel Previous Runs
        uses: styfle/cancel-workflow-action@0.4.1
        with:
          access_token: ${{ github.token }}
      - uses: actions/checkout@v2.3.2
      - name: Cache homebrew packages
        uses: actions/cache@v2
        env:
          cache-name: cache-installed-packages
        with:
          path: |
            $HOME/Library/Caches/Homebrew
            /Library/Caches/Homebrew
            $HOME/.pyenv
          key: homebrew-${{ runner.os }}
          restore-keys: |
            homebrew-${{ runner.os }}
      - name: Upgrade homebrew
        run: cd "$(brew --repo)" && git fetch && git reset --hard origin/master && brew update
      - name: Remove problematic 2to3 bin
        run: rm /usr/local/bin/2to3
      - name: Run install.sh
        run: ./install.sh

Revert "Chore: Temporary disable Archlinux build"
Revert "Chore: Temporary disable Archlinux build"

This reverts commit 7edb425b051ffdb73aac7eb52495bdb5631bee05.
