Repository navigation
81 lines (69 loc) · 2.04 KB
/
Copy pathdocker.yml
File metadata and controls
81 lines (69 loc) · 2.04 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: "Docker"
on:
workflow_dispatch:
push:
schedule:
- cron: "0 8 * * 1"
permissions:
contents: read
jobs:
version:
name: "Version"
runs-on: ubuntu-latest
outputs:
mem0: ${{ steps.version.outputs.mem0 }}
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Resolve version
id: version
run: |
version=$(sed -n 's/^MEM0_VERSION=//p' .env.dist)
for file in Dockerfile dashboard/Dockerfile; do
grep -qx "ARG MEM0_VERSION=${version}" "${file}" || { echo "::error file=${file}::MEM0_VERSION does not match .env.dist (${version})"; exit 1; }
done
echo "mem0=${version}" >> "${GITHUB_OUTPUT}"
build:
name: "Build"
needs: version
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Build images
run: make build
- name: Smoke test images
run: make test
publish:
name: "Publish"
needs: [version, build]
if: ${{ github.ref == 'refs/heads/master' }}
strategy:
matrix:
include:
- { tag: "server", context: "." }
- { tag: "server-${{ needs.version.outputs.mem0 }}", context: "." }
- { tag: "dashboard", context: "dashboard" }
- { tag: "dashboard-${{ needs.version.outputs.mem0 }}", context: "dashboard" }
uses: dockette/.github/.github/workflows/docker.yml@master
secrets: inherit
with:
image: "dockette/memzero"
tag: ${{ matrix.tag }}
context: ${{ matrix.context }}
platforms: "linux/amd64,linux/arm64"
push: true
docs:
name: "Docs"
needs: publish
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/master' }}
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Update Docker Hub description
uses: peter-evans/dockerhub-description@v5
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: dockette/memzero