Skip to content

Commit

Permalink
Try to cache local of github hub
Browse files Browse the repository at this point in the history
  • Loading branch information
vnntsu committed Dec 4, 2023
1 parent 9023d0d commit 0313ce8
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,28 @@ jobs:
with:
ref: ${{ github.event.workflow_run.head_branch || github.ref }}

- name: Set environment variables
run: |
echo "DOCKER_IMAGE_TAG=$DOCKER_REGISTRY/$DOCKER_IMAGE:$BRANCH_TAG" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-multi-buildx
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_TOKEN }}

- name: Set environment variables
run: |
echo "DOCKER_IMAGE_TAG=$DOCKER_REGISTRY/$DOCKER_IMAGE:$BRANCH_TAG" >> $GITHUB_ENV
- name: Prepare Docker image
run: |
bin/docker-prepare
Expand All @@ -65,8 +73,13 @@ jobs:
context: .
push: true
tags: ${{ env.DOCKER_IMAGE_TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new

- name: Move cache to correct location
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Set HEROKU_APP
run: |
Expand Down

0 comments on commit 0313ce8

Please sign in to comment.