-
-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (90 loc) · 3.42 KB
/
Copy pathaimer_docker_builder.yml
File metadata and controls
105 lines (90 loc) · 3.42 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: AIMER Docker Builder
on:
push:
branches:
- 'master'
permissions:
contents: read
id-token: write
packages: write
concurrency:
group: aimer-docker-builder-${{ github.event_name == 'pull_request' && format('{0}-{1}', github.workflow, github.event.pull_request.number) || github.workflow_ref }}
cancel-in-progress: true
jobs:
build-docker-aimer:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- service: aimer-web
dockerfile: ./services/aimer-web/Dockerfile
tags: smartappli/aimer:latest
- service: aimer-rag
dockerfile: ./services/aimer-web/Dockerfile.rag
tags: smartappli/aimer-rag:latest
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: false
swap-storage: true
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- name: Set up QEMU
uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push (${{ matrix.service }})
id: build
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a
with:
context: ./services/aimer-web
file: ${{ matrix.dockerfile }}
push: true
platforms: linux/amd64,linux/arm64
provenance: true
sbom: true
tags: ${{ matrix.tags }}
- name: Install Cosign
uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6
- name: Sign published image (${{ matrix.service }})
env:
DIGEST: ${{ steps.build.outputs.digest }}
IMAGE_REF: ${{ matrix.tags }}
run: cosign sign --yes "${IMAGE_REF}@${DIGEST}"
- name: Write image digest evidence
env:
DIGEST: ${{ steps.build.outputs.digest }}
IMAGE_REF: ${{ matrix.tags }}
run: |
mkdir -p image-digests
printf '%s@%s\n' "${IMAGE_REF}" "${DIGEST}" > "image-digests/${{ matrix.service }}.txt"
- name: Upload image digest evidence
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: image-digest-${{ matrix.service }}
path: image-digests/${{ matrix.service }}.txt
if-no-files-found: error