File tree Expand file tree Collapse file tree 2 files changed +51
-0
lines changed
Expand file tree Collapse file tree 2 files changed +51
-0
lines changed Original file line number Diff line number Diff line change 1+ name : main
2+
3+ on :
4+ push :
5+ branches : ["main"]
6+ pull_request :
7+ branches : ["main"]
8+ release :
9+ types :
10+ - published
11+
12+ jobs :
13+ build :
14+ runs-on : ubuntu-latest
15+ steps :
16+ - name : Prepare
17+ id : prep
18+ run : |
19+ DOCKER_IMAGE=ghcr.io/gdatasoftwareag/fuse-device-plugin
20+ VERSION=edge
21+ if [[ $GITHUB_REF == refs/tags/* ]]; then
22+ VERSION=${GITHUB_REF#refs/tags/}
23+ elif [[ $GITHUB_REF == refs/heads/* ]]; then
24+ VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g')
25+ elif [[ $GITHUB_REF == refs/pull/* ]]; then
26+ VERSION=pr-${{ github.event.number }}
27+ fi
28+ TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${VERSION}-${GITHUB_SHA::8}"
29+ echo ::set-output name=version::${VERSION}
30+ echo ::set-output name=tags::${TAGS}
31+ echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
32+ - name : Login to Github Registry
33+ uses : docker/login-action@v2
34+ with :
35+ registry : ghcr.io
36+ username : ${{ github.actor }}
37+ password : ${{ secrets.GITHUB_TOKEN }}
38+ - name : Push to GitHub Packages
39+ uses : docker/build-push-action@v4
40+ with :
41+ push : ${{ github.event_name == 'release' }}
42+ tags : ${{ steps.prep.outputs.tags }}
43+ labels : |
44+ org.opencontainers.image.revision=${{ github.sha }}
45+ org.opencontainers.image.created=${{ steps.prep.outputs.created }}
Original file line number Diff line number Diff line change @@ -10,3 +10,9 @@ COPY --from=builder /code/fuse-device-plugin/fuse-device-plugin /usr/bin/fuse-de
1010
1111# replace with your desire device count
1212CMD ["fuse-device-plugin" , "--mounts_allowed" , "5000" ]
13+
14+ LABEL org.opencontainers.image.title="Fuse device plugin Docker Image" \
15+ org.opencontainers.image.description="fuse-device-plugin" \
16+ org.opencontainers.image.url="https://github.com/GDATASoftwareAG/fuse-device-plugin" \
17+ org.opencontainers.image.source="https://github.com/GDATASoftwareAG/fuse-device-plugin" \
18+ org.opencontainers.image.license="Apache 2.0"
You can’t perform that action at this time.
0 commit comments