Add docker caches
This commit is contained in:
parent
f8f4220c9e
commit
51da919481
15
.github/workflows/main-build.yml
vendored
15
.github/workflows/main-build.yml
vendored
@ -19,6 +19,7 @@ env:
|
|||||||
REPO: "onlyoffice"
|
REPO: "onlyoffice"
|
||||||
DOCKER_IMAGE_PREFIX: "4testing-docspace"
|
DOCKER_IMAGE_PREFIX: "4testing-docspace"
|
||||||
DOCKERFILE: "Dockerfile.app"
|
DOCKERFILE: "Dockerfile.app"
|
||||||
|
CACHE_DIRECTORY: /home/runner/docker-cache-directory
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
@ -49,6 +50,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Restore Cached Docker layers
|
||||||
|
uses: actions/cache/restore@v4
|
||||||
|
with:
|
||||||
|
path: ${{ env.CACHE_DIRECTORY }}
|
||||||
|
key: ${{ runner.os }}-docker
|
||||||
|
|
||||||
- name: Build 4testing
|
- name: Build 4testing
|
||||||
id: build
|
id: build
|
||||||
@ -69,11 +76,19 @@ jobs:
|
|||||||
--set *.platform=linux/amd64 \
|
--set *.platform=linux/amd64 \
|
||||||
--set *.args.PRODUCT_VERSION=${PRODUCT_VERSION} \
|
--set *.args.PRODUCT_VERSION=${PRODUCT_VERSION} \
|
||||||
--set *.args.BUILD_NUMBER=${{github.run_number}} \
|
--set *.args.BUILD_NUMBER=${{github.run_number}} \
|
||||||
|
--cache-to type=local,dest=${{ env.CACHE_DIRECTORY }} \
|
||||||
|
--cache-from type=local,src=${{ env.CACHE_DIRECTORY }} \
|
||||||
--push
|
--push
|
||||||
|
|
||||||
echo "version=${DOCKER_TAG}" >> "$GITHUB_OUTPUT"
|
echo "version=${DOCKER_TAG}" >> "$GITHUB_OUTPUT"
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
- name: Save Cache Docker layers
|
||||||
|
uses: actions/cache/save@v4
|
||||||
|
with:
|
||||||
|
path: ${{ env.CACHE_DIRECTORY }}
|
||||||
|
key: ${{ runner.os }}-docker
|
||||||
|
|
||||||
- name: Run zap action if needed
|
- name: Run zap action if needed
|
||||||
if: ${{ github.event.action == 'cron-trigger-action' || github.event_name == 'workflow_dispatch' }}
|
if: ${{ github.event.action == 'cron-trigger-action' || github.event_name == 'workflow_dispatch' }}
|
||||||
env:
|
env:
|
||||||
|
Loading…
Reference in New Issue
Block a user