File tree Expand file tree Collapse file tree 4 files changed +104
-11
lines changed
Expand file tree Collapse file tree 4 files changed +104
-11
lines changed Original file line number Diff line number Diff line change 1+ name : Cleanup main images
2+
3+ on :
4+ schedule :
5+ - cron : ' 5 1 * * *'
6+ workflow_dispatch :
7+
8+ env :
9+ REGISTRY : ghcr.io/openmcp-project
10+ IMAGE_NAME : mcp-ui-frontend
11+ KEEP_X_IMAGES : 5
12+
13+ jobs :
14+ clean :
15+ name : ' Clean main images'
16+ runs-on : ubuntu-latest
17+ permissions :
18+ packages : write
19+ steps :
20+ - name : Delete old main branch images
21+ uses : actions/delete-package-versions@e5bc658cc4c965c472efe991f8beea3981499c55 # v5
22+ with :
23+ package-name : ${{ env.IMAGE_NAME }}
24+ package-type : ' container'
25+ min-versions-to-keep : ${{ env.KEEP_X_IMAGES }}
26+ # Ignore any version that does NOT start with 'main-'
27+ ignore-versions : ' ^(?!main-).*$'
Original file line number Diff line number Diff line change 1+ name : Build (main)
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ workflow_dispatch :
8+
9+ env :
10+ REGISTRY : ghcr.io/openmcp-project
11+ IMAGE_NAME : mcp-ui-frontend
12+
13+ jobs :
14+ run-build :
15+ uses : ./.github/workflows/build.yaml
16+
17+ build :
18+ name : Build
19+ runs-on : ubuntu-latest
20+ needs : [run-build]
21+ permissions :
22+ contents : write
23+ packages : write
24+ id-token : write
25+ attestations : write
26+
27+ steps :
28+ - name : Checkout code
29+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
30+
31+ - name : Docker meta
32+ id : meta
33+ uses : docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5
34+ with :
35+ images : ${{env.REGISTRY}}/${{env.IMAGE_NAME}}
36+ tags : |
37+ type=raw,value={{branch}}-{{date 'YYYYMMDDHHmmss'}}
38+
39+ - name : Log in to the Container registry
40+ uses : docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
41+ with :
42+ registry : ${{ env.REGISTRY }}
43+ username : ${{ github.actor }}
44+ password : ${{ secrets.GITHUB_TOKEN }}
45+
46+ - name : Set up QEMU
47+ uses : docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
48+
49+ - name : Set up Docker Buildx
50+ uses : docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
51+
52+ - name : Build and push
53+ uses : docker/build-push-action@1dc73863535b631f98b2378be8619f83b136f4a0 # v6.17.0
54+ with :
55+ context : .
56+ platforms : linux/amd64,linux/arm64
57+ push : true
58+ sbom : true
59+ provenance : mode=max
60+ tags : ${{ steps.meta.outputs.tags }}
61+ labels : ${{ steps.meta.outputs.labels }}
62+ annotations : ${{ steps.meta.outputs.annotations }}
63+ cache-from : type=gha
64+ cache-to : type=gha,mode=max
Original file line number Diff line number Diff line change @@ -24,18 +24,18 @@ jobs:
2424
2525 release :
2626 runs-on : ubuntu-latest
27- needs :
27+ needs :
2828 - run-build
2929
3030 permissions :
3131 contents : write # write release tag to the repo
3232 packages : write # push the container to ghcr
33-
33+
3434 steps :
3535 - name : Checkout code
3636 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3737 with :
38- fetch-depth : 0 # Fetch all history for all tags and branches
38+ fetch-depth : 0 # Fetch all history for all tags and branches
3939
4040 - name : Check if tag already exists
4141 id : check_tag
4747 else
4848 echo "Tag does not exit. Building release version ${{ github.event.inputs.nextVersion }}"
4949 fi
50-
50+
5151 - name : Log in to the Container registry
5252 uses : docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
5353 with :
6161 with :
6262 context : .
6363 push : true
64- tags : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.nextVersion }}
64+ sbom : true
65+ provenance : mode=max
66+ tags : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.nextVersion }}
6567
6668 - name : Create Release with autogenerated release notes
6769 env :
You can’t perform that action at this time.
0 commit comments