Skip to content

Commit df3fb27

Browse files
authored
enabled image build cache on gha (#5)
1 parent a6fd4f2 commit df3fb27

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/ghcr.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
name: Build and push to GHCR
2+
23
on:
34
push:
45
branches: [main]
56
paths:
67
- Containerfile
7-
8+
- .github/workflows/**
89
workflow_dispatch:
910

1011
jobs:
@@ -20,6 +21,8 @@ jobs:
2021
id: vars
2122
run: echo "timestamp=$(date -u +'%Y%m%d-%H%M%S')" >> "$GITHUB_OUTPUT"
2223

24+
- uses: docker/setup-buildx-action@v3
25+
2326
- uses: docker/login-action@v3
2427
with:
2528
registry: ghcr.io
@@ -31,6 +34,8 @@ jobs:
3134
context: .
3235
file: Containerfile
3336
push: true
37+
cache-from: type=gha
38+
cache-to: type=gha,mode=max
3439
tags: |
35-
ghcr.io/${{ github.repository }}:${{ steps.vars.outputs.timestamp }}
3640
ghcr.io/${{ github.repository }}:latest
41+
ghcr.io/${{ github.repository }}:${{ steps.vars.outputs.timestamp }}

0 commit comments

Comments
 (0)