From 2e34c921d5bd3a6c7c51c0035505488497ded8b1 Mon Sep 17 00:00:00 2001 From: Michael Albertz Date: Thu, 5 Jun 2025 14:32:30 +0200 Subject: [PATCH 1/3] Replace outdated CI workflows with Docker build --- .github/workflows/build-docker.yml | 14 +++++ .github/workflows/install-dotfiles.yml | 74 -------------------------- 2 files changed, 14 insertions(+), 74 deletions(-) create mode 100644 .github/workflows/build-docker.yml delete mode 100644 .github/workflows/install-dotfiles.yml diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml new file mode 100644 index 0000000..63e82c3 --- /dev/null +++ b/.github/workflows/build-docker.yml @@ -0,0 +1,14 @@ +name: Build Docker Image + +on: + push: + branches: [main] + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build Docker image + run: docker build -t dotfiles . diff --git a/.github/workflows/install-dotfiles.yml b/.github/workflows/install-dotfiles.yml deleted file mode 100644 index 8768d70..0000000 --- a/.github/workflows/install-dotfiles.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: 'Fresh install dotfiles' - -on: - workflow_dispatch: - push: - branches: - - main - pull_request: - -permissions: - contents: read - pull-requests: read -concurrency: - group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' - cancel-in-progress: true - -env: - HOMEBREW_NO_ANALYTICS: 1 - -jobs: - install-dotfiles: - strategy: - matrix: - os: [ubuntu-latest] - runs-on: ${{ matrix.os }} - steps: - - name: Checkout - id: checkout - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Cache Homebrew - id: cache-homebrew - uses: actions/cache@v4 - if: runner.os != 'macOS' - with: - path: | - /home/linuxbrew/.linuxbrew - key: ${{ runner.os }}-${{ hashFiles('**/Brewfile', '**/Brewfile.lock.json') }}-homebrew - - - name: Cache asdf - id: cache-asdf - uses: actions/cache@v4 - with: - path: | - ~/.asdf - key: ${{ runner.os }}-${{ hashFiles('**/asdf/tool-versions') }}-asdf - - - name: Bootstrap dotfiles - id: bootstrap-dotfiles - run: | - # symlink the dotfiles to the current users home directory - ln -sf $GITHUB_WORKSPACE $HOME/.dotfiles - ./bootstrap - - - name: Setup Homebrew env - id: setup-homebrew-env - if: runner.os != 'macOS' - run: | - # add all relevant env to github actions env - eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" - echo "HOMEBREW_PREFIX=$HOMEBREW_PREFIX" >> "$GITHUB_ENV" - echo "HOMEBREW_CELLAR=$HOMEBREW_CELLAR" >> "$GITHUB_ENV" - echo "HOMEBREW_REPOSITORY=$HOMEBREW_REPOSITORY" >> "$GITHUB_ENV" - echo "$HOMEBREW_PREFIX/bin:$HOMEBREW_PREFIX/sbin" >> "$GITHUB_PATH" - - - name: Verify - id: verify - if: runner.os != 'macOS' - shell: zsh {0} - env: - TERM: xterm-256color - run: ./doctor --nvim From 168f625068b3b44aaaf8d70f04848e0c0f2b32b5 Mon Sep 17 00:00:00 2001 From: Michael Albertz Date: Thu, 5 Jun 2025 14:58:22 +0200 Subject: [PATCH 2/3] Add caching to CI pipelines --- .github/workflows/build-docker.yml | 10 ++++++++-- .gitlab-ci.yml | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 .gitlab-ci.yml diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 63e82c3..c3a6913 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -10,5 +10,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Build Docker image - run: docker build -t dotfiles . + - uses: docker/setup-buildx-action@v3 + - uses: docker/build-push-action@v5 + with: + context: . + push: false + tags: dotfiles + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..36dd3e3 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,22 @@ +image: docker:24.0 +services: + - docker:24.0-dind + +variables: + DOCKER_HOST: tcp://docker:2375/ + DOCKER_TLS_CERTDIR: "" + +stages: + - build + +build: + stage: build + cache: + key: buildx-cache + paths: + - .buildx-cache + script: + - docker buildx create --use + - docker buildx build --cache-from=type=local,src=.buildx-cache \ + --cache-to=type=local,dest=.buildx-cache,mode=max \ + -t dotfiles . From 64e502a775796845d603f65910470d839d6e1601 Mon Sep 17 00:00:00 2001 From: Michael Albertz Date: Thu, 5 Jun 2025 14:58:25 +0200 Subject: [PATCH 3/3] Remove obsolete GitLab CI pipeline --- .gitlab-ci.yml | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 36dd3e3..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,22 +0,0 @@ -image: docker:24.0 -services: - - docker:24.0-dind - -variables: - DOCKER_HOST: tcp://docker:2375/ - DOCKER_TLS_CERTDIR: "" - -stages: - - build - -build: - stage: build - cache: - key: buildx-cache - paths: - - .buildx-cache - script: - - docker buildx create --use - - docker buildx build --cache-from=type=local,src=.buildx-cache \ - --cache-to=type=local,dest=.buildx-cache,mode=max \ - -t dotfiles .