Skip to content

Commit d01a84e

Browse files
committed
fix workflow for following things
- include cache to fix rebuild from scratch - include docker permission
1 parent a96cadd commit d01a84e

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed
Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: DEV - Build and Push to GHCR
1+
name: Coordinate - Build and Push to GHCR
22

33
on:
44
push:
@@ -30,6 +30,25 @@ jobs:
3030
- name: Checkout Code
3131
uses: actions/checkout@v4
3232

33+
- name: Cache CMake build
34+
uses: actions/cache@v3
35+
with:
36+
path: |
37+
build
38+
~/.cache
39+
key: ${{ runner.os }}-cmake-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('**/*.cpp', '**/*.h') }}
40+
restore-keys: |
41+
${{ runner.os }}-cmake-${{ hashFiles('**/CMakeLists.txt') }}-
42+
${{ runner.os }}-cmake-
43+
44+
- name: Cache apt packages
45+
uses: actions/cache@v3
46+
with:
47+
path: /var/cache/apt/archives
48+
key: ${{ runner.os }}-apt-${{ hashFiles('.github/workflows/*.yml') }}
49+
restore-keys: |
50+
${{ runner.os }}-apt-
51+
3352
- name: Create new tag (semantic versioning)
3453
id: tag
3554
uses: mathieudutour/[email protected]
@@ -67,6 +86,13 @@ jobs:
6786
- name: Verify build artifacts
6887
run: ls -la build/bin/
6988

89+
- name: Set up Docker Buildx
90+
uses: docker/setup-buildx-action@v3
91+
92+
- name: Fix Docker socket permissions
93+
run: |
94+
sudo chmod 666 /var/run/docker.sock
95+
7096
- name: Log in to GitHub Container Registry
7197
uses: docker/login-action@v3
7298
with:
@@ -90,4 +116,6 @@ jobs:
90116
context: .
91117
push: true
92118
tags: ${{ steps.meta.outputs.tags }}
93-
labels: ${{ steps.meta.outputs.labels }}
119+
labels: ${{ steps.meta.outputs.labels }}
120+
cache-from: type=registry,ref=ghcr.io/${{ env.IMAGE_NAME }}:buildcache
121+
cache-to: type=registry,ref=ghcr.io/${{ env.IMAGE_NAME }}:buildcache,mode=max

0 commit comments

Comments
 (0)