You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
106 lines
3.4 KiB
YAML
106 lines
3.4 KiB
YAML
name: Cache
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'develop'
|
|
|
|
jobs:
|
|
get-sha:
|
|
uses: ./.github/workflows/search-cache.yml
|
|
|
|
Caching_CVAT:
|
|
needs: search_cache
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
REPO: ${{ github.repository }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/cache@v3
|
|
id: server-cache-action
|
|
with:
|
|
path: /tmp/cvat_cache_server
|
|
key: ${{ runner.os }}-build-server-${{ github.sha }}
|
|
restore-keys: |
|
|
${{ runner.os }}-build-server-${{ needs.get-sha.outputs.sha }}
|
|
${{ runner.os }}-build-server-
|
|
|
|
- uses: actions/cache@v3
|
|
id: ui-cache-action
|
|
with:
|
|
path: /tmp/cvat_cache_ui
|
|
key: ${{ runner.os }}-build-ui-${{ github.sha }}
|
|
restore-keys: |
|
|
${{ runner.os }}-build-ui-${{ needs.get-sha.outputs.sha }}
|
|
${{ runner.os }}-build-ui-
|
|
|
|
- uses: actions/cache@v3
|
|
id: elasticsearch-cache-action
|
|
with:
|
|
path: /tmp/cvat_cache_elasticsearch
|
|
key: ${{ runner.os }}-build-elasticsearch-${{ github.sha }}
|
|
restore-keys: |
|
|
${{ runner.os }}-build-elasticsearch-${{ needs.get-sha.outputs.sha }}
|
|
${{ runner.os }}-build-elasticsearch-
|
|
|
|
- uses: actions/cache@v3
|
|
id: logstash-cache-action
|
|
with:
|
|
path: /tmp/cvat_cache_logstash
|
|
key: ${{ runner.os }}-build-logstash-${{ github.sha }}
|
|
restore-keys: |
|
|
${{ runner.os }}-build-logstash-${{ needs.get-sha.outputs.sha }}
|
|
${{ runner.os }}-build-logstash-
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- name: Caching CVAT Server
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
cache-from: type=local,src=/tmp/cvat_cache_server
|
|
cache-to: type=local,dest=/tmp/cvat_cache_server-new
|
|
|
|
- name: Caching CVAT UI
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile.ui
|
|
cache-from: type=local,src=/tmp/cvat_cache_ui
|
|
cache-to: type=local,dest=/tmp/cvat_cache_ui-new
|
|
|
|
- name: Caching CVAT Elasticsearch
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: ./components/analytics/elasticsearch/
|
|
file: ./components/analytics/elasticsearch/Dockerfile
|
|
cache-from: type=local,src=/tmp/cvat_cache_elasticsearch
|
|
cache-to: type=local,dest=/tmp/cvat_cache_elasticsearch-new
|
|
build-args: ELK_VERSION=6.8.23
|
|
|
|
- name: Caching CVAT Logstash
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: ./components/analytics/logstash/
|
|
file: ./components/analytics/logstash/Dockerfile
|
|
cache-from: type=local,src=/tmp/cvat_cache_logstash
|
|
cache-to: type=local,dest=/tmp/cvat_cache_logstash-new
|
|
build-args: ELK_VERSION=6.8.23
|
|
|
|
- name: Moving cache
|
|
run: |
|
|
rm -rf /tmp/cvat_cache_server
|
|
mv /tmp/cvat_cache_server-new /tmp/cvat_cache_server
|
|
|
|
rm -rf /tmp/cvat_cache_ui
|
|
mv /tmp/cvat_cache_ui-new /tmp/cvat_cache_ui
|
|
|
|
rm -rf /tmp/cvat_cache_elasticsearch
|
|
mv /tmp/cvat_cache_elasticsearch-new /tmp/cvat_cache_elasticsearch
|
|
|
|
rm -rf /tmp/cvat_cache_logstash
|
|
mv /tmp/cvat_cache_logstash-new /tmp/cvat_cache_logstash
|