Skip to content

Commit 71c6fa0

Browse files
committed
ci: test cache
1 parent c9f5242 commit 71c6fa0

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/test.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,47 @@ jobs:
2323

2424
- name: Run tests
2525
run: uv run pytest tests
26+
push_to_docker_hub:
27+
name: Push Docker image to Docker Hub
28+
runs-on: ubuntu-latest
29+
permissions:
30+
contents: read
31+
packages: write
32+
steps:
33+
- name: Check out the repo
34+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
35+
36+
- name: Set up Docker Buildx
37+
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
38+
39+
- name: Log in to Docker Hub
40+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
41+
with:
42+
username: ${{ secrets.DOCKER_USERNAME }}
43+
password: ${{ secrets.DOCKER_PASSWORD }}
44+
45+
- name: Log in to GitHub Container Registry
46+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
47+
with:
48+
registry: ghcr.io
49+
username: ${{ github.actor }}
50+
password: ${{ secrets.GITHUB_TOKEN }}
51+
52+
- name: Extract metadata (tags, labels) for Docker
53+
id: meta
54+
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
55+
with:
56+
images: elementsinteractive/lightman-ai
57+
58+
- name: Build and push Docker image
59+
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
60+
with:
61+
images: docker.io/elementsinteractive/lightman-ai
62+
context: .
63+
file: ./Dockerfile
64+
push: false
65+
platforms: linux/amd64,linux/arm64
66+
tags: ${{ steps.meta.outputs.tags }}
67+
labels: ${{ steps.meta.outputs.labels }}
68+
cache-from: type=registry,ref=ghcr.io/elementsinteractive/lightman-ai:buildcache
69+
cache-to: type=registry,ref=ghcr.io/elementsinteractive/lightman-ai:buildcache,mode=max

0 commit comments

Comments
 (0)