Skip to content

Commit

Permalink
feat(.github): Try to cache build steps
Browse files Browse the repository at this point in the history
Signed-off-by: Diwank Singh Tomer <diwank.singh@gmail.com>
  • Loading branch information
creatorrr committed Apr 17, 2024
1 parent 1e231cd commit 3a1e622
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/push-to-hub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,28 @@ jobs:
username: julepai
password: "${{ secrets.DOCKER_HUB_PASSWORD }}"

- uses: KengoTODA/actions-setup-docker-compose@v1
- name: Cache Docker layers
uses: actions/cache@v3
with:
version: "2.24.6"
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- uses: KengoTODA/actions-setup-docker-compose@main
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

- name: Build images
run: |
touch .env
docker compose build
docker compose build --cache-from type=local,src=/tmp/.buildx-cache
docker compose build --cache-to type=local,dest=/tmp/.buildx-cache-new
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Push images
run: |
Expand Down

0 comments on commit 3a1e622

Please sign in to comment.