forked from intelowlproject/IntelOwl
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (37 loc) · 1.08 KB
/
Copy pathdocker-build-cache.yml
File metadata and controls
45 lines (37 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
permissions:
contents: read
packages: write
name: Docker Build Cache
on:
push:
branches: [develop]
paths-ignore:
- "**.md"
- "docs/**"
- "integrations/**"
jobs:
build-main-image:
runs-on: ubuntu-latest
steps:
- name: Checkout IntelOwl
uses: actions/checkout@v6.0.2
- name: Set image repo
run: echo "IMAGE_REPO=ghcr.io/${GITHUB_REPOSITORY,,}" >> "$GITHUB_ENV"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to GHCR
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build main image and push cache
uses: docker/build-push-action@v7
with:
context: .
file: docker/Dockerfile
push: false
build-args: |
REPO_DOWNLOADER_ENABLED=false
cache-from: type=registry,ref=${{ env.IMAGE_REPO }}:cache-main
cache-to: type=registry,ref=${{ env.IMAGE_REPO }}:cache-main,mode=max